/* Buyer Journey Mapper — scoped styles. Page-local, do not load on other pages. */
#bjm-app { font-family: 'HKGrotesk-Regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #02111B; background: #fff; }
#bjm-app *, #bjm-app *::before, #bjm-app *::after { box-sizing: border-box; }

/* Toolbar */
.bjm-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: 1rem; background: #f8f9fa; border: 1px solid #e6e8ea; border-bottom: none; border-radius: 4px 4px 0 0; }
.bjm-toolbar .bjm-toolbar-group { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.bjm-toolbar .bjm-toolbar-group + .bjm-toolbar-group { margin-left: auto; }
.bjm-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; font-size: .8rem; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; border: 1px solid #d1d5db; background: #fff; color: #02111B; border-radius: 3px; cursor: pointer; transition: border-color .15s, background .15s; }
.bjm-btn:hover { border-color: #007EA7; color: #007EA7; }
.bjm-btn:focus-visible { outline: 2px solid #007EA7; outline-offset: 2px; }
.bjm-btn--primary { background: #02111B; color: #fff; border-color: #02111B; }
.bjm-btn--primary:hover { background: #007EA7; border-color: #007EA7; color: #fff; }
.bjm-btn--ghost { background: transparent; border-color: transparent; color: #555; }
.bjm-btn--ghost:hover { background: #f1f3f5; color: #02111B; border-color: transparent; }
.bjm-btn--sm { padding: .25rem .55rem; font-size: .7rem; }
.bjm-btn[disabled] { opacity: .5; cursor: not-allowed; }
.bjm-toolbar label { font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; color: #6c757d; margin: 0; }
.bjm-select { padding: .4rem .6rem; font-size: .85rem; border: 1px solid #d1d5db; background: #fff; color: #02111B; border-radius: 3px; }

/* Grid */
.bjm-grid-wrap { overflow-x: auto; border: 1px solid #e6e8ea; border-radius: 0 0 4px 4px; background: #fff; }
.bjm-grid { display: grid; min-width: 720px; }
.bjm-grid .bjm-cell { padding: .75rem; border-right: 1px solid #eef0f2; border-bottom: 1px solid #eef0f2; min-height: 110px; }
.bjm-grid .bjm-cell:last-child { border-right: none; }
.bjm-grid .bjm-row-last .bjm-cell { border-bottom: none; }
.bjm-grid .bjm-cell--header { background: #02111B; color: #fff; font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; min-height: auto; padding: .8rem .75rem; display: flex; align-items: center; justify-content: space-between; gap: .35rem; }
.bjm-grid .bjm-cell--corner { background: #02111B; color: rgba(255,255,255,.55); font-size: .65rem; text-transform: uppercase; letter-spacing: 1.5px; min-height: auto; padding: .8rem .75rem; display: flex; align-items: center; }
.bjm-grid .bjm-cell--row-header { background: #f8f9fa; font-weight: 600; font-size: .85rem; color: #02111B; display: flex; align-items: center; justify-content: space-between; gap: .35rem; min-height: 110px; }
.bjm-cell-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bjm-cell-actions { display: flex; gap: .25rem; flex-shrink: 0; }
.bjm-icon-btn { width: 22px; height: 22px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid transparent; color: inherit; opacity: .6; cursor: pointer; border-radius: 2px; font-size: .85rem; line-height: 1; }
.bjm-icon-btn:hover { opacity: 1; background: rgba(255,255,255,.15); }
.bjm-cell--row-header .bjm-icon-btn:hover { background: #e9ecef; }
.bjm-icon-btn:focus-visible { outline: 2px solid #007EA7; outline-offset: 1px; opacity: 1; }
.bjm-persona-icon { display: inline-block; width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; background: #02111B; color: #fff; font-size: .8rem; margin-right: .5rem; flex-shrink: 0; }

/* Touchpoint chips */
.bjm-chips { display: flex; flex-direction: column; gap: .4rem; }
.bjm-chip { display: flex; flex-direction: column; gap: .15rem; padding: .45rem .55rem; background: #f1f7fa; border-left: 3px solid #007EA7; border-radius: 0 3px 3px 0; font-size: .8rem; line-height: 1.3; position: relative; cursor: text; }
.bjm-chip:hover { background: #e6f1f5; }
.bjm-chip-label { font-weight: 500; color: #02111B; word-break: break-word; }
.bjm-chip-channel { font-size: .68rem; text-transform: uppercase; letter-spacing: .5px; color: #6c757d; }
.bjm-chip-remove { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; padding: 0; background: transparent; border: none; color: #adb5bd; font-size: .8rem; line-height: 1; cursor: pointer; border-radius: 2px; opacity: 0; transition: opacity .12s; }
.bjm-chip:hover .bjm-chip-remove,
.bjm-chip-remove:focus-visible { opacity: 1; }
.bjm-chip-remove:hover { color: #dc3545; background: rgba(220,53,69,.08); }
.bjm-add-chip { padding: .35rem .55rem; font-size: .72rem; color: #6c757d; background: transparent; border: 1px dashed #ced4da; border-radius: 3px; cursor: pointer; text-align: left; transition: color .12s, border-color .12s; }
.bjm-add-chip:hover { color: #007EA7; border-color: #007EA7; }
.bjm-add-chip:focus-visible { outline: 2px solid #007EA7; outline-offset: 2px; }

/* Inline editors */
.bjm-inline-input { width: 100%; padding: .35rem .45rem; font-size: .85rem; border: 1px solid #007EA7; background: #fff; border-radius: 2px; color: #02111B; font-family: inherit; }
.bjm-inline-input:focus { outline: none; box-shadow: 0 0 0 2px rgba(0,126,167,.2); }
.bjm-chip-edit { display: flex; flex-direction: column; gap: .3rem; padding: .4rem; background: #fff; border: 1px solid #007EA7; border-left: 3px solid #007EA7; border-radius: 0 3px 3px 0; }
.bjm-chip-edit input { padding: .35rem .45rem; font-size: .8rem; border: 1px solid #d1d5db; background: #fff; border-radius: 2px; }
.bjm-chip-edit input:focus { outline: none; border-color: #007EA7; }
.bjm-chip-edit-actions { display: flex; gap: .35rem; justify-content: flex-end; }

/* Empty / status states */
.bjm-empty { padding: 2rem; text-align: center; color: #6c757d; font-size: .9rem; }
.bjm-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; color: #6c757d; letter-spacing: .5px; }
.bjm-status::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #20c997; }
.bjm-status--saving::before { background: #f9bd1a; }

/* Share dialog */
.bjm-share { margin-top: .75rem; padding: .85rem 1rem; background: #f1f7fa; border: 1px solid #d6e4ec; border-radius: 3px; display: none; align-items: center; gap: .75rem; flex-wrap: wrap; }
.bjm-share.bjm-share--visible { display: flex; }
.bjm-share input { flex: 1; min-width: 220px; padding: .4rem .55rem; font-size: .78rem; border: 1px solid #c5d4dc; background: #fff; border-radius: 2px; font-family: 'SFMono-Regular', Menlo, monospace; color: #02111B; }
.bjm-share .bjm-share-msg { font-size: .75rem; color: #20c997; font-weight: 500; min-width: 60px; }
.bjm-share .bjm-share-msg[hidden] { display: none; }

/* Reset confirm */
.bjm-confirm { margin: 1rem 0 0; padding: .85rem 1rem; background: #fff4e6; border: 1px solid #ffd8a8; border-radius: 3px; font-size: .85rem; color: #02111B; display: none; align-items: center; gap: .75rem; flex-wrap: wrap; }
.bjm-confirm.bjm-confirm--visible { display: flex; }

/* Email capture banner */
.bjm-ec { margin: 1rem 0 0; padding: 1.1rem 1.25rem; background: linear-gradient(135deg, #007EA7 0%, #003F5C 100%); color: #fff; border-radius: 4px; display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; transition: opacity .25s; }
.bjm-ec.bjm-ec--hidden { opacity: 0; }
.bjm-ec-body { flex: 1; min-width: 220px; }
.bjm-ec-h { margin: 0 0 .25rem; font-size: 1rem; font-weight: 700; color: #fff; line-height: 1.3; }
.bjm-ec-p { margin: 0; font-size: .85rem; line-height: 1.5; color: rgba(255,255,255,.85); }
.bjm-ec-actions { display: flex; gap: .5rem; flex-shrink: 0; flex-wrap: wrap; }
.bjm-ec .bjm-btn { border-color: rgba(255,255,255,.4); color: #fff; }
.bjm-ec .bjm-btn:hover { background: rgba(255,255,255,.1); border-color: #fff; color: #fff; }
.bjm-ec .bjm-btn--primary { background: #fff; color: #02111B; border-color: #fff; }
.bjm-ec .bjm-btn--primary:hover { background: #f1f7fa; color: #02111B; border-color: #f1f7fa; }
.bjm-ec .bjm-btn--ghost { background: transparent; border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.85); }
.bjm-ec .bjm-btn--ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
@media (max-width: 600px) {
  .bjm-ec { flex-direction: column; align-items: stretch; }
  .bjm-ec-actions { justify-content: stretch; }
  .bjm-ec-actions .bjm-btn { flex: 1; justify-content: center; }
}
@media print { .bjm-ec { display: none !important; } }

/* Mobile */
@media (max-width: 767px) {
  .bjm-toolbar { padding: .75rem; }
  .bjm-toolbar .bjm-toolbar-group + .bjm-toolbar-group { margin-left: 0; width: 100%; }
  .bjm-btn { font-size: .72rem; padding: .4rem .65rem; }
  .bjm-grid { min-width: 640px; }
  .bjm-grid .bjm-cell { padding: .5rem; min-height: 95px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bjm-btn, .bjm-chip, .bjm-chip-remove, .bjm-add-chip { transition: none; }
}

/* Print: hide toolbar + actions, expose all chips */
@media print {
  .bjm-toolbar, .bjm-cell-actions, .bjm-chip-remove, .bjm-add-chip, .bjm-share, .bjm-confirm { display: none !important; }
  .bjm-grid-wrap { overflow: visible; border: 1px solid #999; }
  .bjm-chip { background: #fff !important; border: 1px solid #999; }
}
