/* ═══════════════════════════════════════════
   StoryCollectr App — New Memory Page
   A storytelling-first creation flow
   ═══════════════════════════════════════════ */

/* ─── Page Shell ─── */
.nm {
  max-width: 700px;
  margin: 0 auto;
  padding: 32px 24px 100px;
}

.nm__page-title {
  font-family: var(--sc-font-display);
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 400;
  color: var(--sc-charcoal);
  text-align: center;
  margin-bottom: 32px;
}

/* ─── Draft hub link + resume banner (device-local drafts) — see draft-workflow mockup ─── */
.nm__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  margin-bottom: 12px;
}

.nm__draft-hub-link {
  font-family: var(--sc-font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--sc-rust);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--sc-rust) 35%, var(--sc-border));
  background: var(--sc-warm-white);
  box-shadow: var(--sc-shadow-xs);
  transition:
    border-color var(--sc-transition-fast),
    box-shadow var(--sc-transition-fast),
    background var(--sc-transition-fast);
}

.nm__draft-hub-link:hover {
  border-color: color-mix(in srgb, var(--sc-rust) 55%, var(--sc-border));
  box-shadow: var(--sc-shadow-sm);
  background: color-mix(in srgb, var(--sc-rust) 6%, var(--sc-warm-white));
}

.nm__draft-hub-link:focus-visible {
  outline: 2px solid var(--sc-rust-soft);
  outline-offset: 2px;
}

/* Card-style alert: solid surface + accent + shadow (color-mix alone was too subtle on cream) */
.nm__resume-banner {
  width: 100%;
  max-width: 700px;
  margin: 0 auto 32px;
  padding: 18px 18px 18px 16px;
  border-radius: var(--sc-radius-lg);
  border: 1px solid var(--sc-border);
  border-left: 4px solid var(--sc-rust);
  background: var(--sc-warm-white);
  background-image: linear-gradient(
    135deg,
    color-mix(in srgb, var(--sc-rust) 9%, var(--sc-warm-white)) 0%,
    var(--sc-cream-dark) 100%
  );
  box-shadow: var(--sc-shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 18px;
}

.nm__resume-banner__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  stroke: var(--sc-rust);
  fill: none;
  margin-top: 3px;
}

.nm__resume-banner__body {
  flex: 1;
  min-width: min(100%, 220px);
}

.nm__resume-banner__title {
  font-family: var(--sc-font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--sc-charcoal);
  margin: 0 0 6px;
  line-height: 1.35;
}

.nm__resume-banner__meta {
  font-family: var(--sc-font-ui);
  font-size: 0.8125rem;
  color: var(--sc-text-secondary);
  margin: 0;
  line-height: 1.5;
  max-width: 52ch;
}

.nm__resume-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1 1 100%;
  margin-top: 4px;
}

/* Wide: actions share row with copy; align to end */
@media (min-width: 640px) {
  .nm__resume-banner {
    align-items: flex-start;
  }

  .nm__resume-banner__actions {
    flex: 0 0 auto;
    max-width: 100%;
    margin-top: 0;
    margin-left: auto;
    align-self: center;
  }
}

.nm__resume-banner__actions .modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-height: 40px;
  padding: 10px 18px;
  font-size: 0.8125rem;
}

@media (max-width: 639px) {
  .nm__resume-banner__actions {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid color-mix(in srgb, var(--sc-border) 88%, transparent);
    justify-content: stretch;
  }

  .nm__resume-banner__actions .modal__btn {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }
}

/* ─── Sections ─── */
.nm__section {
  margin-bottom: 28px;
}

.nm__section-label {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sc-text-tertiary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nm__section-label svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}

.nm__section-label--row {
  justify-content: space-between;
}

.nm__section-label-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nm__section-label .required {
  color: var(--sc-rust);
  font-size: 0.85rem;
  line-height: 1;
}

/* ─── Memory Type Selector (compact) ─── */
.nm__type-grid {
  display: flex;
  gap: 6px;
}

.nm__type-option {
  background: var(--sc-warm-white);
  border: 1.5px solid var(--sc-border);
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nm__type-option:hover { border-color: var(--sc-sand); }

.nm__type-option.active {
  border-color: var(--sc-rust);
  background: rgba(184, 96, 63, 0.04);
}

.nm__type-option svg {
  width: 16px;
  height: 16px;
  stroke: var(--sc-bark-faint);
  fill: none;
  transition: stroke 0.2s;
  flex-shrink: 0;
}

.nm__type-option.active svg { stroke: var(--sc-rust); }

.nm__type-name {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sc-bark);
}

.nm__type-option.active .nm__type-name { color: var(--sc-rust); }

/* ─── Character Reference (source character for character-type memories) ─── */
.nm__char-ref {
  margin-top: 14px;
}

.nm__char-ref-label {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--sc-text-tertiary);
  margin-bottom: 8px;
}

.nm__char-ref-change {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--sc-text-tertiary);
  background: none;
  border: 1px solid var(--sc-border);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.nm__char-ref-change:hover {
  background: var(--sc-cream);
  color: var(--sc-bark);
}

/* ─── Text Inputs ─── */
.nm__input {
  width: 100%;
  font-family: var(--sc-font-ui);
  font-size: 0.95rem;
  color: var(--sc-text-primary);
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  padding: 14px 18px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nm__input:focus {
  border-color: var(--sc-rust-soft);
  box-shadow: 0 0 0 3px rgba(184, 96, 63, 0.08);
}

.nm__input::placeholder { color: var(--sc-text-tertiary); }

.nm__input--title {
  font-family: var(--sc-font-display);
  font-size: 1.3rem;
  padding: 16px 18px;
}

.nm__textarea {
  width: 100%;
  font-family: var(--sc-font-body);
  font-size: 1rem;
  color: var(--sc-text-primary);
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  padding: 16px 18px;
  outline: none;
  resize: vertical;
  min-height: 100px;
  line-height: 1.7;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nm__textarea:focus {
  border-color: var(--sc-rust-soft);
  box-shadow: 0 0 0 3px rgba(184, 96, 63, 0.08);
}

.nm__textarea::placeholder { color: var(--sc-text-tertiary); }

/* ─── Optional Field Toggle (location, date) ─── */
.nm__optional-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  color: var(--sc-text-tertiary);
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.2s;
}

.nm__optional-toggle:hover { color: var(--sc-bark); }

/* Required state (when Location type is selected) */
.nm__optional-toggle--required {
  color: var(--sc-bark);
}

.nm__required-badge {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sc-rust);
  background: rgba(184, 96, 63, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: auto;
}

.nm__optional-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

.nm__optional-toggle .nm__toggle-plus {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--sc-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--sc-text-tertiary);
  transition: border-color 0.2s, color 0.2s;
}

.nm__optional-toggle:hover .nm__toggle-plus {
  border-color: var(--sc-rust-soft);
  color: var(--sc-rust);
}

.nm__optional-content {
  display: none;
  margin-top: 10px;
}

.nm__optional-content.open { display: block; }

/* Location input with icon */
.nm__location-wrap {
  position: relative;
}

.nm__location-wrap > svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--sc-text-tertiary);
  fill: none;
  pointer-events: none;
}

.nm__input--location { padding-left: 42px; }

/* Location picker (family new memory) */
.nm-loc-picker {
  position: relative;
}

.nm-loc-picker__results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  background: var(--sc-warm-white);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.nm-loc-picker__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-family: var(--sc-font-ui);
  font-size: 0.9rem;
  color: var(--sc-bark);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--sc-border);
  cursor: pointer;
}

.nm-loc-picker__item:last-child {
  border-bottom: none;
}

.nm-loc-picker__item:hover,
.nm-loc-picker__item:focus-visible {
  background: var(--sc-cream-dark);
  outline: none;
}

.nm-loc-picker__create {
  display: inline-flex;
}

.nm-loc-selected {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  background: var(--sc-warm-white);
}

.nm-loc-selected__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--sc-cream-dark);
  color: var(--sc-rust);
}

.nm-loc-selected__icon svg {
  width: 18px;
  height: 18px;
}

.nm-loc-selected__info {
  flex: 1;
  min-width: 0;
}

.nm-loc-selected__name {
  font-family: var(--sc-font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--sc-bark);
}

.nm-loc-selected__remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--sc-text-tertiary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.nm-loc-selected__remove:hover {
  color: var(--sc-bark);
  background: var(--sc-cream-dark);
}

/* ─── Date Picker ─── */
.nm__date-card {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  padding: 16px;
}

.nm__date-preview {
  font-family: var(--sc-font-display);
  font-size: 0.92rem;
  font-style: italic;
  color: var(--sc-rust);
  margin-left: auto;
}

.nm__date-modes {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.nm__date-mode {
  font-family: var(--sc-font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sc-bark-faint);
  background: var(--sc-cream-dark);
  border: 1px solid var(--sc-border);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  text-align: center;
}

.nm__date-mode:hover { border-color: var(--sc-sand); }

.nm__date-mode.active {
  background: var(--sc-rust);
  border-color: var(--sc-rust);
  color: white;
}

.nm__date-fields {
  display: flex;
  gap: 10px;
  align-items: end;
}

.nm__date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nm__date-field label {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--sc-text-tertiary);
}

.nm__date-field select,
.nm__date-field input {
  font-family: var(--sc-font-ui);
  font-size: 0.88rem;
  color: var(--sc-bark);
  background: var(--sc-cream);
  border: 1px solid var(--sc-border);
  border-radius: 8px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
}

.nm__date-field select:focus,
.nm__date-field input:focus { border-color: var(--sc-rust-soft); }

.nm__date-field--grow { flex: 1; }
.nm__date-field--grow select { width: 100%; }

.nm__date-range-sep {
  font-size: 1.1rem;
  color: var(--sc-text-tertiary);
  padding-bottom: 8px;
}

/* ─── Recording Section ─── */
.nm__record-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.nm__record-photo-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.nm__record-option {
  background: var(--sc-warm-white);
  border: 2px solid var(--sc-border);
  border-radius: 14px;
  padding: 22px 14px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.nm__record-option:hover {
  border-color: var(--sc-sand);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(90, 64, 50, 0.08);
}

.nm__record-option.active {
  border-color: var(--sc-rust);
  background: rgba(184, 96, 63, 0.03);
}

.nm__record-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  stroke: var(--sc-bark-faint);
  fill: none;
  transition: stroke 0.2s;
}

.nm__record-option:hover .nm__record-icon { stroke: var(--sc-rust-soft); }
.nm__record-option.active .nm__record-icon { stroke: var(--sc-rust); }

.nm__record-name {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sc-bark);
  margin-bottom: 3px;
}

.nm__record-desc {
  font-family: var(--sc-font-ui);
  font-size: 0.68rem;
  color: var(--sc-text-tertiary);
  line-height: 1.4;
}

/* ─── Uploaded Media Items ─── */
.nm__media-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.nm__media-item {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nm__media-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nm__media-item-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

.nm__media-item-icon--audio {
  background: rgba(184, 96, 63, 0.08);
  color: var(--sc-rust);
}

.nm__media-item-icon--video {
  background: rgba(92, 64, 51, 0.06);
  color: var(--sc-bark);
}

.nm__media-item-icon--text {
  background: rgba(107, 127, 94, 0.08);
  color: var(--sc-sage);
}

.nm__media-item-info {
  flex: 1;
  min-width: 0;
}

.nm__media-item-name {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sc-bark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nm__media-item-meta {
  font-family: var(--sc-font-ui);
  font-size: 0.7rem;
  color: var(--sc-text-tertiary);
}

.nm__media-item-remove {
  background: none;
  border: none;
  color: var(--sc-text-tertiary);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  transition: color 0.15s;
}

.nm__media-item-remove:hover { color: var(--sc-rust); }

/* ─── Photos Gallery — 4 columns, reuses photo-grid ─── */
.nm__photo-gallery {
  columns: 4;
  column-gap: 8px;
}

.nm__photo-gallery .photo-grid__item {
  margin-bottom: 8px;
}

/* ─── Visibility Selector ─── */
.nm__visibility {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.nm__visibility-option {
  background: var(--sc-warm-white);
  border: 1.5px solid var(--sc-border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.nm__visibility-option:hover { border-color: var(--sc-sand); }

.nm__visibility-option.active {
  border-color: var(--sc-rust);
  background: rgba(184, 96, 63, 0.03);
}

.nm__visibility-option svg {
  width: 22px;
  height: 22px;
  stroke: var(--sc-bark-faint);
  fill: none;
  margin-bottom: 6px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  transition: stroke 0.2s;
}

.nm__visibility-option.active svg { stroke: var(--sc-rust); }

.nm__visibility-name {
  font-family: var(--sc-font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sc-bark);
  margin-bottom: 2px;
}

.nm__visibility-desc {
  font-family: var(--sc-font-ui);
  font-size: 0.65rem;
  color: var(--sc-text-tertiary);
}

.nm__acl-custom {
  padding-top: var(--sc-space-sm);
  border-top: 1px solid var(--sc-border-subtle);
}

.nm__acl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nm__acl-row {
  display: flex;
  align-items: center;
  gap: var(--sc-space-sm);
  font-size: var(--sc-text-sm);
}

.nm__acl-row .form-chip__remove {
  margin-left: auto;
}

.nm__acl-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sc-space-sm);
}

.nm__acl-add .form-input {
  flex: 1;
  min-width: 140px;
}

/* ─── Custom Sharing Panel ─── */
.nm__sharing {
  display: none;
  background: var(--sc-cream);
  border: 1px solid var(--sc-border-subtle);
  border-radius: 12px;
  padding: 18px;
  margin-top: 10px;
}

.nm__sharing.open { display: block; }

.nm__sharing-section {
  margin-bottom: 16px;
}

.nm__sharing-section:last-child { margin-bottom: 0; }

.nm__sharing-section-label {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sc-text-tertiary);
  margin-bottom: 8px;
}

/* Shared user/group items with permission dropdown */
.nm__share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.nm__share-item + .nm__share-item {
  border-top: 1px solid var(--sc-border-subtle);
}

.nm__share-item-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sc-font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.nm__share-item-avatar--group {
  border-radius: 8px;
  background: var(--sc-cream-dark);
  color: var(--sc-bark-faint);
}

.nm__share-item-avatar--group svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

.nm__share-item-name {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sc-bark);
  flex: 1;
}

.nm__share-item-perm {
  font-family: var(--sc-font-ui);
  font-size: 0.75rem;
  color: var(--sc-bark);
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23A49A90' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

.nm__share-item-remove {
  background: none;
  border: none;
  color: var(--sc-text-tertiary);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px;
  transition: color 0.15s;
}

.nm__share-item-remove:hover { color: var(--sc-rust); }

/* ─── Media Creation Modals ─── */

/* Upload drop zone */
.nm__dropzone {
  border: 2px dashed var(--sc-border);
  border-radius: 14px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--sc-cream);
}

.nm__dropzone:hover,
.nm__dropzone.dragover {
  border-color: var(--sc-rust-soft);
  background: rgba(184, 96, 63, 0.03);
}

.nm__dropzone__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  stroke: var(--sc-bark-faint);
  fill: none;
}

.nm__dropzone.dragover .nm__dropzone__icon { stroke: var(--sc-rust); }

.nm__dropzone__title {
  font-family: var(--sc-font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sc-bark);
  margin-bottom: 4px;
}

.nm__dropzone__subtitle {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  color: var(--sc-text-tertiary);
}

.nm__dropzone__subtitle a {
  color: var(--sc-rust);
  text-decoration: underline;
  cursor: pointer;
}

/* Upload preview grid */
.nm__upload-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.nm__upload-preview:empty { display: none; }

.nm__upload-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
}

.nm__upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nm__upload-thumb__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.55);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.nm__upload-thumb:hover .nm__upload-thumb__remove { opacity: 1; }

/* Recording modal interface */
.nm__recorder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px 0;
}

.nm__recorder__visual {
  width: 100%;
  height: 120px;
  background: var(--sc-cream);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Waveform bars animation */
.nm__waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 80px;
}

.nm__waveform__bar {
  width: 4px;
  border-radius: 2px;
  background: var(--sc-rust-soft);
  animation: waveform 0.8s ease-in-out infinite alternate;
}

.nm__waveform__bar:nth-child(odd) { animation-direction: alternate-reverse; }

@keyframes waveform {
  0% { height: 12px; opacity: 0.4; }
  100% { height: 60px; opacity: 1; }
}

/* Stagger each bar */
.nm__waveform__bar:nth-child(1) { animation-delay: 0s; }
.nm__waveform__bar:nth-child(2) { animation-delay: 0.1s; }
.nm__waveform__bar:nth-child(3) { animation-delay: 0.2s; }
.nm__waveform__bar:nth-child(4) { animation-delay: 0.05s; }
.nm__waveform__bar:nth-child(5) { animation-delay: 0.15s; }
.nm__waveform__bar:nth-child(6) { animation-delay: 0.25s; }
.nm__waveform__bar:nth-child(7) { animation-delay: 0.08s; }
.nm__waveform__bar:nth-child(8) { animation-delay: 0.18s; }
.nm__waveform__bar:nth-child(9) { animation-delay: 0.12s; }
.nm__waveform__bar:nth-child(10) { animation-delay: 0.22s; }
.nm__waveform__bar:nth-child(11) { animation-delay: 0.03s; }
.nm__waveform__bar:nth-child(12) { animation-delay: 0.16s; }
.nm__waveform__bar:nth-child(13) { animation-delay: 0.07s; }
.nm__waveform__bar:nth-child(14) { animation-delay: 0.2s; }
.nm__waveform__bar:nth-child(15) { animation-delay: 0.13s; }
.nm__waveform__bar:nth-child(16) { animation-delay: 0.09s; }
.nm__waveform__bar:nth-child(17) { animation-delay: 0.23s; }
.nm__waveform__bar:nth-child(18) { animation-delay: 0.04s; }
.nm__waveform__bar:nth-child(19) { animation-delay: 0.19s; }
.nm__waveform__bar:nth-child(20) { animation-delay: 0.11s; }

.nm__waveform--paused .nm__waveform__bar {
  animation-play-state: paused;
}

/* Real-time input meter — bars use scaleY from script */
.nm__waveform--live {
  align-items: flex-end;
}

.nm__waveform--live .nm__waveform__bar {
  animation: none;
  height: 56px;
  transform-origin: center bottom;
  opacity: 0.95;
}

.nm__recorder__timer {
  font-family: var(--sc-font-ui);
  font-size: 2rem;
  font-weight: 300;
  color: var(--sc-bark);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.nm__recorder__controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nm__recorder__btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.2s;
}

.nm__recorder__btn:hover { transform: scale(1.05); }

.nm__recorder__btn--record {
  background: var(--sc-rust);
  color: white;
  box-shadow: 0 4px 16px rgba(184, 96, 63, 0.3);
}

.nm__recorder__btn--record svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: none;
}

.nm__recorder__btn--record.recording {
  background: #c0392b;
  animation: pulse-record 1.5s ease-in-out infinite;
}

@keyframes pulse-record {
  0%, 100% { box-shadow: 0 4px 16px rgba(184, 96, 63, 0.3); }
  50% { box-shadow: 0 4px 24px rgba(192, 57, 43, 0.5); }
}

.nm__recorder__btn--stop {
  background: var(--sc-cream-dark);
  color: var(--sc-bark);
}

.nm__recorder__btn--stop svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
}

.nm__recorder__btn--sm {
  width: 40px;
  height: 40px;
}

.nm__recorder__btn--sm svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

.nm__recorder__status {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  color: var(--sc-text-tertiary);
}

.nm__recorder__status--recording { color: #c0392b; }

/* Video recorder — live camera preview (--preview-ar, --ar-w, --ar-h set from JS) */
.nm__camera-preview {
  width: min(100%, calc(min(62dvh, 32rem) * (var(--ar-w, 16) / var(--ar-h, 9))));
  max-width: 100%;
  max-height: min(62dvh, 32rem);
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: var(--preview-ar, 16 / 9);
  background: #1a1a1a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.nm__camera-preview__placeholder {
  text-align: center;
  color: rgba(255,255,255,0.4);
}

.nm__camera-preview__placeholder svg {
  width: 48px;
  height: 48px;
  stroke: currentColor;
  fill: none;
  margin-bottom: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.nm__camera-preview__placeholder span {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
}

.nm__camera-preview__timer {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 4px;
  display: none;
}

.nm__camera-preview__timer.visible { display: block; }

.nm__camera-preview__rec {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  color: #c0392b;
  display: none;
}

.nm__camera-preview__rec.visible { display: flex; }

.nm__camera-preview__rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c0392b;
  animation: pulse-record 1.5s ease-in-out infinite;
}

/* Scan frame overlay */
.nm__scan-frame {
  position: absolute;
  inset: 24px;
  border: 2px dashed rgba(255,255,255,0.3);
  border-radius: 8px;
}

.nm__scan-frame__corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--sc-rust);
  border-style: solid;
  border-width: 0;
}

.nm__scan-frame__corner--tl { top: -1px; left: -1px; border-top-width: 3px; border-left-width: 3px; border-radius: 4px 0 0 0; }
.nm__scan-frame__corner--tr { top: -1px; right: -1px; border-top-width: 3px; border-right-width: 3px; border-radius: 0 4px 0 0; }
.nm__scan-frame__corner--bl { bottom: -1px; left: -1px; border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 4px; }
.nm__scan-frame__corner--br { bottom: -1px; right: -1px; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 4px 0; }

/* Story editor */
.nm__story-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nm__story-editor__toolbar {
  display: flex;
  gap: 2px;
  background: var(--sc-cream);
  border: 1px solid var(--sc-border-subtle);
  border-radius: 8px;
  padding: 4px;
}

.nm__story-editor__toolbar-btn {
  background: none;
  border: none;
  color: var(--sc-bark-faint);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--sc-font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nm__story-editor__toolbar-btn:hover {
  background: var(--sc-cream-dark);
  color: var(--sc-bark);
}

.nm__story-editor__toolbar-btn.active {
  background: var(--sc-warm-white);
  color: var(--sc-bark);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.nm__story-editor__toolbar-sep {
  width: 1px;
  background: var(--sc-border-subtle);
  margin: 4px 2px;
}

.nm__story-editor__content {
  width: 100%;
  min-height: 260px;
  font-family: var(--sc-font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--sc-text-primary);
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  padding: 18px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nm__story-editor__content:focus {
  border-color: var(--sc-rust-soft);
  box-shadow: 0 0 0 3px rgba(184, 96, 63, 0.08);
}

.nm__story-editor__content:empty::before {
  content: attr(data-placeholder);
  color: var(--sc-text-tertiary);
  pointer-events: none;
}

.nm__story-editor__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nm__story-editor__word-count {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: var(--sc-text-tertiary);
}

/* Media player — audio playback in modal */
.nm__player {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
}

.nm__player__visual {
  width: 100%;
  height: 100px;
  background: var(--sc-cream);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Playback waveform — static bars */
.nm__player-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 70px;
  padding: 0 16px;
  width: 100%;
}

.nm__player-waveform__bar {
  flex: 1;
  border-radius: 1px;
  background: var(--sc-border);
  transition: background 0.15s;
}

.nm__player-waveform__bar.played { background: var(--sc-rust-soft); }

.nm__player-waveform--peaks {
  align-items: flex-end;
}

.nm__player-waveform--peaks .nm__player-waveform__bar {
  min-height: 4px;
  max-height: 100%;
}

.nm__player__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nm__player__play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sc-rust);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.nm__player__play:hover { background: var(--sc-bark); }

.nm__player__play svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
}

.nm__player__progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nm__player__progress-bar {
  width: 100%;
  height: 4px;
  background: var(--sc-border-subtle);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

.nm__player__progress-fill {
  height: 100%;
  background: var(--sc-rust);
  border-radius: 2px;
  width: 35%;
  transition: width 0.1s;
}

.nm__player__timestamps {
  display: flex;
  justify-content: space-between;
  font-family: var(--sc-font-ui);
  font-size: 0.7rem;
  color: var(--sc-text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* Video player (preview playback — --preview-ar / --ar-w / --ar-h from RecordingModal) */
.nm__video-player {
  width: min(100%, calc(min(62dvh, 32rem) * (var(--ar-w, 16) / var(--ar-h, 9))));
  max-width: 100%;
  max-height: min(62dvh, 32rem);
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: var(--preview-ar, 16 / 9);
  background: #1a1a1a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.nm__video-player__play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255,255,255,0.3);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.nm__video-player__play:hover {
  background: rgba(255,255,255,0.25);
}

.nm__video-player__play svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  stroke: none;
  margin-left: 3px;
}

.nm__video-player__bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: white;
  font-variant-numeric: tabular-nums;
}

.nm__video-player__bar-progress {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

.nm__video-player__bar-fill {
  height: 100%;
  background: var(--sc-rust);
  border-radius: 2px;
  width: 28%;
}

/* ─── Modal Phase Management ─── */
/* Phases: ready → recording → preview (audio/video) */
/* Phases: streaming → captured (photo) */
/* Phases: streaming → processing → adjusting → captured (scanner) */
.nm__phase { display: none; }
.nm__phase.active { display: block; }
.nm__phase--flex.active { display: flex; }

/* ─── Camera Toggle (front/rear) ─── */
.nm__camera-toggle {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}

.nm__camera-toggle:hover { background: rgba(0,0,0,0.7); }

.nm__camera-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

/* ─── Captured Photo Preview ─── */
.nm__captured-preview {
  width: min(100%, calc(min(62dvh, 32rem) * (var(--ar-w, 16) / var(--ar-h, 9))));
  max-width: 100%;
  max-height: min(62dvh, 32rem);
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: var(--preview-ar, 16 / 9);
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.nm__captured-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ─── Audio/Video Preview Phase ─── */
.nm__preview-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.nm__preview-actions .modal__btn { min-width: 120px; }

/* ─── Scanner Adjustments ─── */
.nm__scanner-adjust {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
}

.nm__scanner-canvas {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #1a1a1a;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.nm__scanner-canvas img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Draggable corner handles (button reset for <button type="button">) */
.nm__corner-handle {
  position: absolute;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: 3px solid var(--sc-rust);
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  cursor: grab;
  transform: translate(-50%, -50%);
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  color: inherit;
  touch-action: none;
}

.nm__corner-handle:hover,
.nm__corner-handle:active,
.nm__corner-handle--dragging {
  box-shadow: 0 2px 12px rgba(184, 96, 63, 0.5);
  cursor: grabbing;
}

.nm__corner-handle--tl { top: 15%; left: 12%; }
.nm__corner-handle--tr { top: 14%; left: 88%; }
.nm__corner-handle--bl { top: 86%; left: 13%; }
.nm__corner-handle--br { top: 85%; left: 87%; }

/* Connecting lines between corners */
.nm__scanner-canvas svg.nm__crop-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.nm__crop-lines polygon {
  fill: rgba(184, 96, 63, 0.08);
  stroke: var(--sc-rust);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}

/* Scanner control sliders */
.nm__scanner-controls {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.nm__scanner-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 160px;
}

.nm__scanner-control label {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sc-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
}

.nm__scanner-control label span {
  color: var(--sc-bark);
  font-weight: 500;
  text-transform: none;
}

.nm__scanner-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--sc-border);
  border-radius: 2px;
  outline: none;
}

.nm__scanner-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--sc-rust);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Glare reduction toggle */
.nm__scanner-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  color: var(--sc-bark);
  cursor: pointer;
}

.nm__scanner-toggle input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 20px;
  background: var(--sc-border);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.nm__scanner-toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.nm__scanner-toggle input[type="checkbox"]:checked {
  background: var(--sc-rust);
}

.nm__scanner-toggle input[type="checkbox"]:checked::after {
  transform: translateX(16px);
}

/* ─── Upload Limit Indicator ─── */
.nm__upload-limit {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: var(--sc-text-tertiary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.nm__upload-limit__bar {
  width: 80px;
  height: 3px;
  background: var(--sc-border-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.nm__upload-limit__fill {
  height: 100%;
  background: var(--sc-rust-soft);
  border-radius: 2px;
  transition: width 0.3s;
}

.nm__upload-limit__types {
  font-family: var(--sc-font-ui);
  font-size: 0.68rem;
  color: var(--sc-text-tertiary);
  margin-top: 6px;
}

/* ─── Prompt Context Banner ─── */
.nm__prompt-context {
  background: var(--sc-cream);
  border: 1px solid var(--sc-border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.nm__prompt-context__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(184, 96, 63, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nm__prompt-context__icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--sc-rust);
  fill: none;
}

.nm__prompt-context__body {
  flex: 1;
  min-width: 0;
}

.nm__prompt-context__label {
  font-family: var(--sc-font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sc-rust);
  margin-bottom: 2px;
}

.nm__prompt-context__question {
  font-family: var(--sc-font-body);
  font-size: 0.88rem;
  color: var(--sc-bark);
  line-height: 1.5;
}

.nm__prompt-context__photos {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.nm__prompt-context__photo {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
}

.nm__prompt-context__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── Draft Auto-Save Indicator ─── */
.nm__draft-status {
  font-family: var(--sc-font-ui);
  font-size: 0.7rem;
  color: var(--sc-text-tertiary);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
}

.nm__draft-status svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
}

.nm__draft-status--saving { color: var(--sc-rust-soft); }
.nm__draft-status--saved { color: var(--sc-sage); }

/* ─── Responsive adjustments ─── */
@media (max-width: 600px) {
  .nm__upload-preview { grid-template-columns: repeat(3, 1fr); }
  .nm__recorder__timer { font-size: 1.6rem; }
  .nm__scanner-controls { flex-direction: column; }
  .nm__preview-actions { flex-direction: column; }
  .nm__preview-actions .modal__btn { min-width: unset; width: 100%; }
}

/* Printed photo scanner: adjusting canvas on narrow screens (live preview uses JS --preview-ar) */
@media (max-width: 768px) {
  .printed-photo-scanner .nm__scanner-canvas {
    aspect-ratio: 3 / 4;
  }
}

/* ─── Save Actions ─── */
.nm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--sc-border-subtle);
  margin-top: 12px;
}

/* ─── Section Dividers ─── */
.nm__divider {
  height: 1px;
  background: var(--sc-border-subtle);
  margin: 8px 0;
}

/* ─── Prompt reply context (from ?promptId) ─── */
.nm__prompt-reply {
  padding: 16px 18px;
  margin: -12px auto 24px;
  max-width: 100%;
  background: rgba(107, 127, 94, 0.06);
  border: 1px solid rgba(107, 127, 94, 0.18);
  border-radius: 12px;
}

.nm__prompt-reply-label {
  font-family: var(--sc-font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sc-sage);
  display: block;
  margin-bottom: 6px;
}

.nm__prompt-reply-text {
  font-family: var(--sc-font-ui);
  font-size: 0.95rem;
  color: var(--sc-bark);
  margin: 0;
  line-height: 1.45;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .nm { padding: 20px 16px 80px; }
  .nm__type-grid { flex-wrap: wrap; }
  .nm__record-options { grid-template-columns: 1fr; }
  .nm__photo-gallery { columns: 2; }
  .nm__photo-buttons { flex-wrap: wrap; }
  .nm__visibility { grid-template-columns: 1fr; }
  .nm__date-modes { flex-wrap: wrap; }
  .nm__date-fields { flex-wrap: wrap; }
}

/* FlexibleDatePicker inside `.nm` optional band — align with mockup `nm__date-card` (memory-new.php) */
.nm .nm-date-picker-host .flex-date-controls {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  padding: 16px;
}

.nm .nm-date-picker-host .flex-date-precision-btn.active {
  background: var(--sc-rust);
  border-color: var(--sc-rust);
  color: white;
}

/* Live camera + preview video inside recording modals (Svelte RecordingModal) */
.nm__camera-preview__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  background: #1a1a1a;
}

.nm__video-player__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* TipTap RichTextEditor inside `.nm__story-editor` — match write-story-modal.php chrome */
.nm__story-editor .rich-text-editor {
  border: none;
  background: transparent;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: none;
}

.nm__story-editor .rich-text-editor:focus-within {
  border-color: transparent;
  box-shadow: none;
}

.nm__story-editor .rich-text-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--sc-cream);
  border: 1px solid var(--sc-border-subtle);
  border-radius: 8px;
  padding: 4px;
  border-bottom: none;
}

.nm__story-editor .rich-text-toolbar-btn {
  width: auto;
  min-width: 2rem;
  height: auto;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--sc-font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sc-bark-faint);
  background: none;
}

.nm__story-editor .rich-text-toolbar-btn:hover {
  background: var(--sc-cream-dark);
  color: var(--sc-bark);
}

.nm__story-editor .rich-text-toolbar-btn.active {
  background: var(--sc-warm-white);
  color: var(--sc-bark);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.nm__story-editor .rich-text-toolbar-sep {
  width: 1px;
  height: auto;
  align-self: stretch;
  min-height: 1.25rem;
  margin: 4px 2px;
  background: var(--sc-border-subtle);
}

.nm__story-editor .rich-text-editor-container {
  min-height: 260px;
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  overflow: auto;
  background: var(--sc-warm-white);
}

.nm__story-editor .rich-text-editor-content {
  min-height: 240px;
  padding: 18px;
  line-height: 1.8;
}
