/* experience_editor/editor.css – Editor panel header, click-to-edit, fields */

/* ── Panel 2 outer (Solution A layout) ──
   Top space-6, bottom space-10, no horizontal padding (sections handle x-padding). */
.ee-editor {
  padding: var(--space-6) 0 var(--space-10) 0;
  display: flex;
  flex-direction: column;
}

/* ── Flat variant (no internal sections) ──
   The default `.ee-editor` is x-padding-free because its sub-sections
   (.ee-step-section, .ee-dm-section--*) supply their own x-padding, and some
   sections need to stretch edge to edge (DM tabs, element stack).
   Views that use a flat layout — fields flow directly inside `.ee-editor__form`
   with no section wrappers (org editor, member editor; see CLAUDE.md lesson 13)
   have no internal section to carry x-padding, so the outer wrapper carries it. */
.ee-editor--flat {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

/* ── Section A — Step Definition Section (px space-4) ──
   Houses the header row + the settings form (description / view mode / associations). */
.ee-step-section {
  padding: 0 var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ── Solid divider between Section A and Section B (Interactive only) ──
   Edge-to-edge (px 0); space-6 above and below. Mirrors the panel divider line.
   Candidate for promotion to canonical DS as `.ds-divider`. */
.ee-divider {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-6) 0;
}

/* ── DM sub-region wrappers (Solution A · Panel 2B/C/D) ── */
.ee-dm-section--tabs     { padding: 0; }
.ee-dm-section--elements { padding: 0; }
.ee-dm-section--footer   { padding: 0; }

/* ── Scoped overrides — ensure clean background within editor ── */
.ee-editor .form-input,
.ee-editor .form-textarea,
.ee-editor .form-select {
  background-color: var(--surface-base);
}
.ee-editor .form-checkbox {
  accent-color: var(--accent-primary);
}

/* ── Form wrapper — guarantees section spacing ── */
.ee-editor__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
/* Zero out form-group margin — the form's gap handles spacing */
.ee-editor__form .form-group {
  margin-bottom: 0;
}
.ee-editor__form > .ee-section + .ee-section {
  margin-top: 0; /* gap handles spacing */
}

.ee-editor__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.ee-editor__identity { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.ee-editor__name {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  cursor: text;
  color: var(--text-primary);
}
.ee-editor__name:hover { border-bottom: 1px dashed var(--accent-primary); }
.ee-editor__name-input {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-md);
  background: var(--input-bg);
}
.ee-editor__actions { display: flex; gap: var(--space-1); flex-shrink: 0; }

/* ── Click-to-edit ── */
.click-to-edit { position: relative; display: flex; align-items: center; gap: var(--space-1); }
.click-to-edit__indicator {
  position: absolute;
  right: -20px; top: 50%;
  transform: translateY(-50%);
  color: var(--status-success);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.click-to-edit__indicator .material-symbols-rounded { font-size: 14px; }
.click-to-edit__indicator--visible { opacity: 1; }

/* ── Field layout inside accordion ── */
.ee-fields { display: flex; flex-direction: column; gap: var(--space-3); }
.ee-fields .form-group { margin-bottom: 0; }
.ee-field--inline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

/* ── Labels — high contrast readability ── */
.ee-editor .form-label {
  color: var(--text-primary);
  font-weight: 700;
  font-size: var(--text-sm);
}
.ee-editor .form-hint {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}
.ee-editor .form-label--inline {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Switch (toggle) row ── */
.ee-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}
.ee-switch-row__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}
.ee-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.ee-switch__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ee-switch__track {
  width: 40px;
  height: 22px;
  background: var(--border-default);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--duration-fast) var(--ease-out);
}
.ee-switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-out);
}
.ee-switch__input:checked + .ee-switch__track {
  background: var(--accent-primary);
}
.ee-switch__input:checked + .ee-switch__track::after {
  transform: translateX(18px);
}
.ee-switch__input:focus-visible + .ee-switch__track {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ── Required field indicator ── */
.form-required {
  color: var(--status-error);
  font-weight: 700;
}

/* ── Assignment type segmented control ── */
.ee-toggle-group {
  display: flex;
  gap: var(--space-1);
  background: var(--accent-subtle);
  border: 2px solid var(--accent-muted);
  border-radius: var(--radius-lg);
  padding: 3px;
}
.ee-toggle-option {
  display: flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.ee-toggle-option:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.ee-toggle-option:has(input:checked) {
  background: var(--accent-primary);
  color: var(--text-on-accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.ee-toggle-option input[type="radio"] { display: none; }

/* ── FilterSettings preset picker (V19) ── */
.ee-preset-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.ee-preset-option {
  display: flex;
  align-items: center;
  padding: var(--space-0-5) var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  color: var(--text-secondary);
}
.ee-preset-option:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}
.ee-preset-option:has(input:checked) {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  font-weight: 500;
}
.ee-preset-option--custom:has(input:checked) {
  background: var(--surface-sunken);
  border-color: var(--border-default);
  color: var(--text-secondary);
}
.ee-preset-option input[type="radio"] { display: none; }

/* ── Associated models — icon toolbar + cards ── */
.ee-assoc-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.ee-assoc-toolbar__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-right: var(--space-2);
}
.ee-assoc-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-base);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}
.ee-assoc-add-btn:hover {
  border-color: var(--text-secondary);
  color: var(--accent-primary);
  background: var(--surface-hover);
  box-shadow: var(--shadow-sm);
}
.ee-assoc-add-btn .material-symbols-rounded {
  font-size: 18px;
}
.ee-assoc-add-btn__tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  padding: var(--space-1) var(--space-2);
  background: var(--text-primary);
  color: var(--text-inverse);
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-out);
  z-index: var(--z-tooltip);
}
.ee-assoc-add-btn:hover .ee-assoc-add-btn__tooltip {
  opacity: 1;
}

/* ── Association section headings ── */
.ee-assoc-section {
  border-top: 1px solid var(--border-default);
  padding-top: var(--space-3);
  margin-top: var(--space-3);
}
.ee-assoc-section:first-child {
  border-top: none;
  margin-top: 0;
}
.ee-assoc-section__heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-2);
}
.ee-assoc-section__heading .material-symbols-rounded {
  font-size: 18px;
  color: var(--accent-primary);
}
.ee-assoc-section__heading .ee-assoc-count {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-hover);
  padding: 1px var(--space-1-5);
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}
.ee-assoc-section__empty {
  padding: var(--space-3) var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-style: italic;
  text-align: center;
}
/* Auto-hide empty state when sibling cards exist (handles turbo stream add/remove) */
:has(> .ee-assoc-card) > .ee-assoc-section__empty { display: none; }

/* ── Association cards ── */
.ee-assoc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
}
.ee-assoc-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}
.ee-assoc-card__body {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  flex: 1;
  cursor: pointer;
}
.ee-assoc-card__icon {
  font-size: 16px;
  color: var(--accent-primary);
  flex-shrink: 0;
}
.ee-assoc-card__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ee-assoc-card__meta {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  white-space: nowrap;
  background: var(--surface-hover);
  padding: 1px var(--space-1-5);
  border-radius: var(--radius-sm);
}
.ee-assoc-card__actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.ee-assoc-card:hover .ee-assoc-card__actions {
  opacity: 1;
}

/* ── Association forms ── */
.ee-assoc-form {
  margin-top: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}
.ee-assoc-form .form-row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.ee-assoc-form .form-row > * { flex: 1; }
.ee-assoc-form__footer {
  display: flex;
  justify-content: flex-end;
}

/* ── AI Assist button (V14) ── */
.ee-ai-assist {
  display: inline-flex;
  margin-left: auto;
}
.ee-ai-assist__btn {
  gap: var(--space-1);
  font-size: var(--text-xs);
}
/* ── Download stub (V14) ── */
.ee-download-stub {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Coming Soon modal content ── */
.coming-soon {
  text-align: center;
  padding: var(--space-2) 0;
}
.coming-soon__icon {
  font-size: 48px;
  color: var(--accent-primary);
  margin-bottom: var(--space-3);
}
.coming-soon__heading {
  font-size: var(--text-lg, 18px);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-2);
}
.coming-soon__description {
  font-size: var(--text-sm, 14px);
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 var(--space-4);
  max-width: 400px;
  margin-inline: auto;
}
.coming-soon__features {
  text-align: left;
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 360px;
}
.coming-soon__features li {
  display: flex;
  align-items: first baseline;
  gap: var(--space-2);
  font-size: var(--text-sm, 13px);
  color: var(--text-secondary);
  padding: var(--space-1) 0;
}
.coming-soon__features li::before {
  content: "check_circle";
  font-family: "Material Symbols Rounded";
  font-size: 16px;
  line-height: 1;
  color: var(--accent-primary);
  flex-shrink: 0;
  transform: translateY(1px);
}

/* ── Preview toggle (P key) ── */
.experience-editor__preview--collapsed {
  display: none;
}
.experience-editor:has(.experience-editor__preview--collapsed) {
  grid-template-columns: var(--ee-tree-width) 1fr;
}

/* ── Suggestion banner (V24) ── */
.ee-suggestion {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-muted);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-md);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}
.ee-suggestion--visible {
  opacity: 1;
  transform: translateY(0);
}
.ee-suggestion--exiting {
  animation: toast-exit var(--duration-fast) var(--ease-in) forwards;
}
.ee-suggestion__icon {
  flex-shrink: 0;
  font-size: 20px;
  color: var(--accent-primary);
}
.ee-suggestion__message {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.ee-suggestion__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
/* Fix button_to form wrapper alignment within suggestion actions */
.ee-suggestion__actions form {
  display: contents;
}
.ee-suggestion__dismiss {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ee-suggestion__dismiss:hover {
  color: var(--text-primary);
}

/* ── Step type icon in header ── */
.ee-editor__type-icon {
  font-size: 24px;
  color: var(--accent-primary);
  vertical-align: middle;
  margin-right: var(--space-1);
}

/* ── Compact toggle group (smaller for inline use) ── */
.ee-toggle-group--compact {
  display: inline-flex;
  border-width: 1px;
}
.ee-toggle-group--compact .ee-toggle-option {
  padding: var(--space-0-5) var(--space-2);
  font-size: var(--text-xs);
}

/* ── Icon toggle (assignment type — icon buttons that toggle) ── */
.ee-icon-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.ee-icon-toggle__option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--accent-muted);
  border-radius: var(--radius-lg);
  background: var(--surface-base);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}
.ee-icon-toggle__option:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-subtle);
}
.ee-icon-toggle__option:has(input:checked) {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
.ee-icon-toggle__option input[type="radio"] { display: none; }
.ee-icon-toggle__option .material-symbols-rounded { font-size: 18px; }
.ee-icon-toggle__tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-1) var(--space-2);
  background: var(--text-primary);
  color: var(--text-inverse);
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.ee-icon-toggle__option:hover .ee-icon-toggle__tooltip {
  opacity: 1;
}

/* ── Participation hero summary — user progress is king ── */
.ee-participation-hero {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.3;
  color: var(--accent-primary);
  padding: var(--space-3) var(--space-4);
  background: var(--accent-subtle);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.ee-participation-hero--empty {
  color: var(--text-tertiary);
  font-weight: 400;
  font-style: italic;
  font-size: var(--text-sm);
}

/* Inline role select — looks like text, acts like a dropdown */
.ee-participation-hero__role {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-bottom: 2px dashed currentColor;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  padding: 0 var(--space-4) 0 0;
  margin: 0;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}
.ee-participation-hero__role:hover {
  border-bottom-style: solid;
}
.ee-participation-hero__role:focus {
  border-bottom-color: var(--text-primary);
  border-bottom-style: solid;
}
.ee-participation-hero--empty .ee-participation-hero__role {
  font-size: var(--text-sm);
  font-weight: 400;
  font-style: italic;
  border-bottom-style: dotted;
}
.ee-participation-hero__suffix {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Hero row — flat row of pill-style selectors ── */
.ee-hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.ee-hero-row__suffix {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
}
.ee-hero-row__connector {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
}

/* Select-pill — select overlays the entire pill for full-area clickability */
.ee-picker__trigger--select {
  position: relative;
}
.ee-hero-pill__select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: none;
  font: inherit;
  margin: 0;
  padding: 0;
}
.ee-hero-pill__text {
  pointer-events: none;
}
.ee-hero-pill__empty {
  color: var(--text-tertiary);
  font-style: italic;
  font-weight: 400;
}

/* Inline picker modifier — sits on same row as other pills */
.ee-picker--inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}
.ee-picker--inline .ee-picker__chips {
  display: inline-flex;
  flex-wrap: wrap;
}
.ee-picker--inline .ee-picker__chips:not(:empty) {
  margin-bottom: 0;
}
.ee-picker--inline .ee-picker__dropdown {
  min-width: 260px;
  right: auto;
}

/* Duration empty state inside pill */
.ee-scheduling-hero__detail--empty {
  color: var(--text-tertiary);
  font-style: italic;
}

/* ── Scheduling hero summary — fully interactive ── */
.ee-scheduling-hero {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.3;
  color: var(--accent-primary);
  padding: var(--space-3) var(--space-4);
  background: var(--accent-subtle);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  position: relative;
}

/* Inline trigger select — looks like text, acts like a dropdown */
.ee-scheduling-hero__trigger {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-bottom: 2px dashed currentColor;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  padding: 0 var(--space-4) 0 0;
  margin: 0;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}
.ee-scheduling-hero__trigger:hover {
  border-bottom-style: solid;
}
.ee-scheduling-hero__trigger:focus {
  border-bottom-color: var(--text-primary);
  border-bottom-style: solid;
}

/* Clickable detail spans — timing phrase + duration phrase */
.ee-scheduling-hero__detail {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 2px dashed var(--text-tertiary);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out);
}
.ee-scheduling-hero__detail:hover {
  border-bottom-color: var(--accent-primary);
  border-bottom-style: solid;
}
.ee-scheduling-hero__detail--empty {
  color: var(--text-tertiary);
  font-weight: 400;
  font-style: italic;
  font-size: var(--text-sm);
  border-bottom-style: dotted;
}

/* Separator between timing and duration */
.ee-scheduling-hero__sep {
  color: var(--text-primary);
  font-weight: 600;
}

/* Two-row hero layout (row 1: schedule, row 2: duration) */
.ee-scheduling-hero__row + .ee-scheduling-hero__row {
  margin-top: var(--space-1);
}

/* ── Dialog modal — uses <dialog>.showModal() for top-layer rendering ── */
/* This avoids position:fixed issues caused by ancestor transforms       */
.ee-modal-dialog {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  overflow: hidden;
}
.ee-modal-dialog[open] {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ee-modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: ee-backdrop-in 0.2s ease-out;
}
@keyframes ee-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Modal panel ── */
.ee-modal {
  background: var(--surface-base);
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px 16px 0 0;
  animation: ee-modal-up 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes ee-modal-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* Grab handle (mobile bottom-sheet affordance) */
.ee-modal::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 10px auto 0;
  background: var(--border-default);
  border-radius: 2px;
}

.ee-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 10px;
}
.ee-modal__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.ee-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: var(--surface-raised);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
}
.ee-modal__close:hover {
  background: var(--border-default);
}
.ee-modal__close:focus,
.ee-modal__close:focus-visible {
  outline: none;
}
.ee-modal__close .material-symbols-rounded {
  font-size: 18px;
}

.ee-modal__body {
  padding: 8px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ee-modal__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ee-modal__field[hidden] {
  display: none;
}

/* Org-only fields — hidden unless assignment type is Organization */
.ee-org-only[hidden] {
  display: none;
}

/* ── Nag picker — ADD-style icon + inline dropdown ── */
.ee-nag-picker {
  position: relative;
}
.ee-nag-picker__dropdown {
  top: 100%;
  margin-top: var(--space-1);
}
.ee-nag-picker .ee-assoc-card {
  margin-top: var(--space-2);
}
.ee-modal__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Form controls inside modal — touch-friendly 16px prevents iOS zoom */
.ee-modal__body .form-select,
.ee-modal__body .form-input {
  font-size: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border-default);
  width: 100%;
  background: var(--surface-base);
  transition: border-color 0.15s;
}
.ee-modal__body .form-select:focus,
.ee-modal__body .form-input:focus {
  border-color: var(--accent-primary);
  outline: none;
}

/* ── Modal selectable list (e.g. nag step picker) ── */
.ee-modal__list {
  display: flex;
  flex-direction: column;
}
.ee-modal__list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border-default);
}
.ee-modal__list-item:last-child {
  border-bottom: none;
}
.ee-modal__list-item:hover {
  background: var(--accent-subtle);
}
.ee-modal__list-item:active {
  background: var(--accent-muted);
}
.ee-modal__list-icon {
  font-size: 20px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.ee-modal__list-label {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}
.ee-modal__list-check {
  font-size: 20px;
  color: var(--accent-primary);
  opacity: 0;
  flex-shrink: 0;
}
.ee-modal__list-item--active .ee-modal__list-icon {
  color: var(--accent-primary);
}
.ee-modal__list-item--active .ee-modal__list-label {
  color: var(--accent-primary);
  font-weight: 600;
}
.ee-modal__list-item--active .ee-modal__list-check {
  opacity: 1;
}

.ee-modal__footer {
  padding: 0 20px 20px;
}
.ee-modal__done {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: var(--accent-primary);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.ee-modal__done:hover {
  opacity: 0.88;
}
.ee-modal__done:active {
  opacity: 0.75;
}

/* ── Compound time input (D / H / M) ── */
.ee-compound-time {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}
.ee-compound-time__field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ee-compound-time__input {
  width: 64px;
  height: 52px;
  text-align: center;
  padding: 0 !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  border: 1.5px solid var(--border-default) !important;
  background: var(--surface-base);
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}
.ee-compound-time__input:focus {
  border-color: var(--accent-primary) !important;
  outline: none;
}
.ee-compound-time__input::-webkit-inner-spin-button,
.ee-compound-time__input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ee-compound-time__unit {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* Divider between fields */
.ee-modal__divider {
  height: 1px;
  background: var(--border-default);
  margin: 2px 0;
}

/* ── Desktop: centered modal ── */
@media (min-width: 640px) {
  .ee-modal-dialog[open] {
    align-items: center;
  }
  .ee-modal {
    max-width: 380px;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    animation: ee-modal-fade 0.2s ease-out;
  }
  .ee-modal::before {
    display: none;
  }
  @keyframes ee-modal-fade {
    from { transform: scale(0.96) translateY(8px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
  }
}

/* ── Chips (selected items) ── */
.ee-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2) 2px var(--space-2);
  background: var(--accent-primary);
  color: white;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.ee-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  background: rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: var(--radius-full);
  cursor: pointer;
  padding: 0;
  transition: background var(--duration-fast) var(--ease-out);
}
.ee-chip__remove:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* ── Multi-picker ── */
.ee-picker {
  position: relative;
}
.ee-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.ee-picker__chips:not(:empty) {
  margin-bottom: var(--space-2);
}
.ee-picker__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 1px dashed var(--accent-muted);
  border-radius: var(--radius-md);
  background: none;
  color: var(--accent-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.ee-picker__trigger:hover {
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
}
.ee-picker__caret {
  font-size: 16px;
}
.ee-picker__dropdown {
  position: absolute;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown, 100);
  margin-top: var(--space-1);
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
/* Popover-enabled dropdowns: escape panel overflow via top layer */
.ee-picker__dropdown[popover] {
  position: fixed;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-base);
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  max-height: 280px;
  overflow: hidden;
  overflow-y: auto;
}
/* Static (inline) dropdowns inside modals: no floating shadow */
.modal .ee-picker__dropdown {
  box-shadow: none;
}
/* Modal Multi-Select: give the options list room to breathe inside a modal,
   while keeping the search pinned above and scrolling internally. */
.modal .ee-picker__options {
  max-height: 60vh;
}
.ee-picker__search {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-bottom: 1px solid var(--border-default);
  font-size: var(--text-sm);
  outline: none;
  background: var(--surface-base);
}
.ee-picker__search::placeholder {
  color: var(--text-secondary);
}
.ee-picker__options {
  max-height: 200px;
  overflow-y: auto;
}
.ee-picker__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
/* `display: flex` above overrides the browser's default [hidden] rule;
   restore it so list-filter and other hidden-toggling controllers work. */
.ee-picker__option[hidden] {
  display: none;
}
.ee-picker__option:hover {
  background: var(--surface-hover);
}
.ee-picker__option input[type="checkbox"],
.ee-picker__option input[type="radio"] {
  accent-color: var(--accent-primary);
  flex-shrink: 0;
}
.ee-picker__option-label {
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.ee-picker__empty {
  padding: var(--space-3);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-style: italic;
}

/* ── ee-presentation-picker — visual 3-card style selector ── */
.ee-presentation-picker { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-3); margin-top: var(--space-2); }
.ee-presentation-picker__card { border: 2px solid var(--border-subtle); border-radius: var(--radius-lg); cursor: pointer; transition: all var(--duration-fast) var(--ease-out); background: var(--surface-base); overflow: hidden; display: flex; flex-direction: column; }
.ee-presentation-picker__card:hover { border-color: var(--border-default); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.ee-presentation-picker__card--selected { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-subtle); }
.ee-presentation-picker__input { position: absolute; opacity: 0; pointer-events: none; }
.ee-presentation-picker__thumb { aspect-ratio: 4/3; background: linear-gradient(135deg, var(--brand-50), var(--brand-200)); }
.ee-presentation-picker__body { padding: var(--space-2) var(--space-3); }
.ee-presentation-picker__name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary); display: flex; align-items: center; gap: var(--space-1); }
.ee-presentation-picker__check { color: var(--accent-primary); font-size: 14px; display: none; }
.ee-presentation-picker__card--selected .ee-presentation-picker__check { display: inline-block; }
.ee-presentation-picker__desc { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; line-height: var(--leading-snug); }

/* ── ee-icon-picker — Material Symbols inline picker ── */
.ee-icon-picker { position: relative; display: inline-block; }
.ee-icon-picker__trigger { width: 36px; height: 36px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--surface-base); display: inline-flex; align-items: center; justify-content: center; color: var(--accent-primary); cursor: pointer; transition: border-color var(--duration-fast); }
.ee-icon-picker__trigger:hover { border-color: var(--accent-primary); }
.ee-icon-picker__trigger .material-symbols-rounded { font-size: 18px; }
.ee-icon-picker__popover { position: absolute; top: calc(100% + 4px); left: 0; z-index: var(--z-dropdown); background: var(--surface-base); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: var(--space-2); min-width: 280px; }
.ee-icon-picker__search { width: 100%; padding: var(--space-1) var(--space-2); border: 1px solid var(--input-border); border-radius: var(--radius-sm); margin-bottom: var(--space-2); font-size: var(--text-xs); }
.ee-icon-picker__grid { display: grid; grid-template-columns: repeat(8, 32px); gap: var(--space-1); max-height: 240px; overflow-y: auto; }
.ee-icon-picker__icon { width: 32px; height: 32px; border-radius: var(--radius-sm); border: none; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-secondary); }
.ee-icon-picker__icon:hover { background: var(--surface-hover); color: var(--accent-primary); }
.ee-icon-picker__icon .material-symbols-rounded { font-size: 18px; }
