/* PM Settings — shared across Command Center / Regional / PM tools */

.pm-settings-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.pm-settings-page h1 {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  font-size: 32px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: var(--ink, #202020);
}

.pm-settings-lead {
  font-size: 14px;
  color: var(--jr-darkgray, #404040);
  margin-bottom: 28px;
  line-height: 1.6;
}

.pm-settings-version {
  opacity: 0.55;
  font-size: 9px;
  letter-spacing: 1px;
}

.pm-settings-section {
  margin-bottom: 28px;
}

.pm-settings-section-title {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--jr-darkgray, #404040);
  margin-bottom: 10px;
}

.pm-settings-card {
  background: var(--white, #fff);
  border: 1px solid var(--line, #ececec);
  border-radius: var(--radius, 6px);
  overflow: hidden;
}

.pm-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line, #ececec);
}

.pm-settings-row:last-child {
  border-bottom: none;
}

.pm-settings-row--stack {
  flex-direction: column;
  align-items: stretch;
}

.pm-settings-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink, #202020);
}

.pm-settings-hint {
  font-size: 12px;
  color: var(--jr-darkgray, #404040);
  margin-top: 4px;
  line-height: 1.45;
}

.pm-settings-value {
  font-family: var(--font, 'Inter', Arial, sans-serif);
  font-size: 13px;
  word-break: break-all;
  color: var(--ink, #202020);
}

.pm-settings-identity-name {
  font-family: var(--font, 'Inter', Arial, sans-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink, #202020);
  margin-top: 4px;
  line-height: 1.25;
}

.pm-settings-identity-email {
  font-family: var(--font, 'Inter', Arial, sans-serif);
  font-size: 13px;
  color: var(--jr-darkgray, #404040);
  margin-top: 4px;
  word-break: break-all;
}

.pm-settings-user-pill {
  cursor: default;
  max-width: 220px;
}

.pm-settings-user-pill #pm-settings-header-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-settings-user-pill--signed-in {
  border-color: var(--health-green, #1f4d0f);
  background: rgba(31, 77, 15, 0.06);
}

.pm-settings-btn--danger:disabled {
  opacity: 0.45;
  cursor: default;
}

.pm-settings-select,
.pm-settings-input {
  width: 100%;
  max-width: 280px;
  background: var(--tint, #fafaf9);
  border: 1px solid var(--line2, #dcdcdc);
  border-radius: var(--radius, 6px);
  padding: 8px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--ink, #202020);
}

.pm-settings-row--stack .pm-settings-select {
  max-width: none;
}

.pm-settings-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.pm-settings-check input {
  margin-top: 3px;
  flex-shrink: 0;
}

.pm-theme-seg {
  display: inline-flex;
  border: 1px solid var(--line2, #dcdcdc);
  border-radius: var(--radius, 6px);
  overflow: hidden;
}

.pm-theme-seg-btn {
  border: none;
  background: var(--white, #fff);
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink, #202020);
}

.pm-theme-seg-btn + .pm-theme-seg-btn {
  border-left: 1px solid var(--line2, #dcdcdc);
}

.pm-theme-seg-btn.active {
  background: var(--jr-red-tint, #fcebeb);
  color: var(--jr-red, #e92a2c);
  font-weight: 600;
}

.pm-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.pm-settings-btn {
  border: none;
  border-radius: var(--radius, 6px);
  padding: 10px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.pm-settings-btn--primary {
  background: var(--jr-grad, linear-gradient(135deg, #e92a2c, #a71f23));
  color: #fff;
}

.pm-settings-btn--ghost {
  background: var(--white, #fff);
  border: 1px solid var(--line2, #dcdcdc);
  color: var(--ink, #202020);
}

.pm-settings-btn--danger {
  background: transparent;
  border: 1px solid var(--line2, #dcdcdc);
  color: var(--jr-darkgray, #404040);
}

.pm-settings-save-status {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--jr-darkgray, #404040);
  margin-top: 10px;
}

.pm-settings-save-status--ok {
  color: var(--health-green, #1f4d0f);
}

.pm-settings-links {
  display: flex;
  flex-direction: column;
}

.pm-settings-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink, #202020);
  border-bottom: 1px solid var(--line, #ececec);
  font-size: 14px;
}

.pm-settings-link:last-child {
  border-bottom: none;
}

.pm-settings-link:hover {
  background: var(--tint, #fafaf9);
}

.pm-settings-link span {
  font-size: 12px;
  color: var(--jr-darkgray, #404040);
}

html[data-theme="dark"] body.pm-settings-body {
  background: #151515;
  color: #e6e6e6;
}

html[data-theme="dark"] .pm-settings-page h1 {
  color: #e6e6e6;
}

html[data-theme="dark"] .pm-settings-lead,
html[data-theme="dark"] .pm-settings-hint,
html[data-theme="dark"] .pm-settings-section-title,
html[data-theme="dark"] .pm-settings-sub-title {
  color: #bfbfbf;
}

html[data-theme="dark"] .pm-settings-card {
  background: #202020;
  border-color: #404040;
}

html[data-theme="dark"] .pm-settings-row {
  border-color: #404040;
}

html[data-theme="dark"] .pm-settings-label,
html[data-theme="dark"] .pm-settings-value,
html[data-theme="dark"] .pm-settings-identity-name,
html[data-theme="dark"] .pm-settings-link {
  color: #e6e6e6;
}

html[data-theme="dark"] .pm-settings-identity-email {
  color: #bfbfbf;
}

html[data-theme="dark"] .pm-settings-select,
html[data-theme="dark"] .pm-settings-input {
  background: #2a2a2a;
  border-color: #505050;
  color: #e6e6e6;
}

html[data-theme="dark"] .pm-theme-seg {
  border-color: #505050;
}

html[data-theme="dark"] .pm-theme-seg-btn {
  background: #2a2a2a;
  color: #e6e6e6;
}

html[data-theme="dark"] .pm-theme-seg-btn + .pm-theme-seg-btn {
  border-left-color: #505050;
}

html[data-theme="dark"] .pm-theme-seg-btn:hover {
  background: #333;
}

html[data-theme="dark"] .pm-theme-seg-btn.active {
  background: linear-gradient(135deg, #e92a2c, #a71f23);
  color: #fff;
}

html[data-theme="dark"] .pm-settings-btn--ghost {
  background: #2a2a2a;
  border-color: #505050;
  color: #e6e6e6;
}

html[data-theme="dark"] .pm-settings-btn--danger {
  border-color: #505050;
  color: #bfbfbf;
}

html[data-theme="dark"] .pm-settings-link:hover {
  background: #2a2a2a;
}

html[data-theme="dark"] .pm-settings-link span {
  color: #bfbfbf;
}

html[data-theme="dark"] .pm-settings-save-status {
  color: #bfbfbf;
}

html[data-theme="dark"] .pm-settings-general-details {
  background: #202020;
  border-color: #404040;
}

html[data-theme="dark"] .pm-settings-general-summary {
  color: #bfbfbf;
}

html[data-theme="dark"] .pm-settings-general-details[open] .pm-settings-general-summary {
  border-bottom-color: #404040;
}

html[data-theme="dark"] .pm-settings-sub-chip {
  background: #2a2a2a;
  border-color: #505050;
  color: #e6e6e6;
}

html[data-theme="dark"] .pm-settings-sub-chip.is-on {
  background: rgba(233, 42, 44, 0.15);
  border-color: #e92a2c;
  color: #ff8a8c;
}

@media (max-width: 768px) {
  .pm-settings-page {
    padding: 16px 14px 72px;
  }

  .pm-settings-row {
    flex-direction: column;
    align-items: stretch;
  }

  .pm-settings-select {
    max-width: none;
  }
}

.pm-settings-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 2px 0;
}

/* Work Queue settings — full-width panel (not sidebar-width) */
.pm-settings-ewq-section {
  margin-bottom: 32px;
}

.pm-settings-ewq-lead {
  margin: 0 0 14px;
  max-width: 56rem;
}

.pm-settings-ewq-section .ewq-settings-card {
  max-width: none;
  width: 100%;
  border-radius: 0;
}

.pm-settings-ewq-section #pm-settings-ewq-preview-count {
  display: none;
}

.pm-settings-ewq-actions {
  margin-top: 16px;
  max-width: none;
}

#pm-settings-ewq-subscriptions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px 28px;
  align-items: start;
}

#pm-settings-ewq-subscriptions .queue-sub-section {
  margin-bottom: 0;
}

#pm-settings-ewq-status-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#pm-settings-ewq-status-tabs .status-tab {
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 9px 8px;
}

.pm-settings-ewq-section .ewq-nav-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px 28px;
  align-items: start;
}

.pm-settings-ewq-section .ewq-nav-footer-actions {
  grid-column: 1 / -1;
}

.pm-settings-ewq-section #pm-settings-ewq-teams.queue-sub-chips {
  max-height: none;
}

/* One header only — from=escalation-work-queue uses Work Queue banner */
html:not(.pm-settings-from-ewq) #pm-settings-ewq-header {
  display: none !important;
}

html.pm-settings-from-ewq #pm-settings-default-header {
  display: none !important;
}

html.pm-settings-from-ewq #pm-settings-ewq-header {
  display: flex !important;
}

html.pm-settings-from-ewq #pm-settings-page-intro,
html.pm-settings-from-ewq #pm-settings-save-row {
  display: none !important;
}

.pm-settings-general-details {
  margin-bottom: 28px;
  border: 1px solid var(--line, #ececec);
  border-radius: var(--radius, 6px);
  background: var(--white, #fff);
  padding: 0 16px 8px;
}

.pm-settings-general-summary {
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--jr-darkgray, #404040);
  padding: 14px 0;
  list-style: none;
}

.pm-settings-general-summary::-webkit-details-marker {
  display: none;
}

.pm-settings-general-details[open] .pm-settings-general-summary {
  border-bottom: 1px solid var(--line, #ececec);
  margin-bottom: 8px;
}

/* Opened from escalation-work-queue.html — same shell as Work Queue page */
html.pm-settings-from-ewq body,
body.pm-settings-from-ewq {
  background: #fff;
}

html.pm-settings-from-ewq[data-theme="dark"] body,
html[data-theme="dark"].pm-settings-from-ewq body,
body.pm-settings-from-ewq[data-theme="dark"] {
  background: #151515 !important;
}

html.pm-settings-from-ewq .pm-settings-page,
body.pm-settings-from-ewq .pm-settings-page {
  max-width: none;
  width: 100%;
  padding: 16px 24px 48px;
  box-sizing: border-box;
}

html.pm-settings-from-ewq .pm-settings-ewq-section,
body.pm-settings-from-ewq .pm-settings-ewq-section {
  max-width: none;
  width: 100%;
}

html.pm-settings-from-ewq .pm-settings-general-details,
body.pm-settings-from-ewq .pm-settings-general-details {
  max-width: none;
  width: 100%;
  margin-top: 24px;
}

html.pm-settings-from-ewq #pm-settings-help-title,
body.pm-settings-from-ewq .pm-settings-section:has(#pm-settings-help-title) {
  max-width: none;
}

html.pm-settings-from-ewq .pm-settings-ewq-actions,
body.pm-settings-from-ewq .pm-settings-ewq-actions {
  position: sticky;
  bottom: 0;
  z-index: 50;
  margin-top: 20px;
  padding: 12px 0 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 28%);
}

html.pm-settings-from-ewq[data-theme="dark"] .pm-settings-ewq-actions,
html[data-theme="dark"].pm-settings-from-ewq .pm-settings-ewq-actions,
body.pm-settings-from-ewq[data-theme="dark"] .pm-settings-ewq-actions {
  background: linear-gradient(180deg, rgba(21, 21, 21, 0) 0%, #151515 28%);
}

html.pm-settings-from-ewq .pm-settings-ewq-section > .pm-settings-section-title,
body.pm-settings-from-ewq .pm-settings-ewq-section > .pm-settings-section-title {
  display: none;
}

html.pm-settings-from-ewq .pm-settings-ewq-lead,
body.pm-settings-from-ewq .pm-settings-ewq-lead {
  display: none;
}

html.pm-settings-from-ewq .pm-settings-ewq-section .ewq-settings-card,
body.pm-settings-from-ewq .pm-settings-ewq-section .ewq-settings-card {
  box-shadow: 0 1px 0 rgba(26, 26, 26, 0.04), 0 8px 24px rgba(26, 26, 26, 0.06);
}

html.pm-settings-from-ewq[data-theme="dark"] .pm-settings-ewq-section .ewq-settings-card,
html[data-theme="dark"].pm-settings-from-ewq .pm-settings-ewq-section .ewq-settings-card {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.45);
}

html.pm-settings-from-ewq .pm-settings-appearance-section,
body.pm-settings-from-ewq .pm-settings-appearance-section {
  margin-bottom: 20px;
}

html.pm-settings-from-ewq .pm-settings-btn--primary,
body.pm-settings-from-ewq .pm-settings-btn--primary {
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0;
  padding: 10px 16px;
}

html.pm-settings-from-ewq #pm-settings-help-title,
body.pm-settings-from-ewq #pm-settings-help-title {
  margin-top: 8px;
}

.pm-settings-ewq-section #pm-settings-ewq-teams.queue-sub-chips {
  max-height: none;
  overflow: visible;
}

html[data-theme="dark"] .pm-settings-ewq-section .ewq-settings-card {
  background: #202020;
  border-color: #404040;
}

html[data-theme="dark"] .pm-settings-ewq-section .ewq-settings-card::before {
  opacity: 1;
}

html[data-theme="dark"] .pm-settings-ewq-section .ewq-settings-card .card-head {
  background: #2a2a2a;
  border-color: #404040;
}

html[data-theme="dark"] .pm-settings-ewq-section .ewq-settings-card .card-head .section-title {
  color: #e6e6e6;
}

html[data-theme="dark"] .pm-settings-ewq-section .scope-tabs,
html[data-theme="dark"] .pm-settings-ewq-section .status-tab {
  background: #202020;
  border-color: #404040;
  color: #bfbfbf;
}

html[data-theme="dark"] .pm-settings-ewq-section .scope-tab.active,
html[data-theme="dark"] .pm-settings-ewq-section .status-tab.active {
  color: #e6e6e6;
}

html[data-theme="dark"] .pm-settings-ewq-section .queue-view-bar,
html[data-theme="dark"] .pm-settings-ewq-section .ewq-nav-footer,
html[data-theme="dark"] .pm-settings-ewq-section .status-tabs--done {
  background: #2a2a2a;
  border-color: #404040;
}

html[data-theme="dark"] .pm-settings-ewq-section .queue-view-label {
  color: #e6e6e6;
}

html[data-theme="dark"] .pm-settings-ewq-section .queue-view-meta {
  color: #bfbfbf;
}

html[data-theme="dark"] .pm-settings-ewq-section .ewq-nav-sub-wrap {
  background: #202020;
  border-color: #404040;
}

html[data-theme="dark"] .pm-settings-ewq-section .queue-sub-chip {
  background: #2a2a2a;
  border-color: #505050;
  color: #e6e6e6;
}

html[data-theme="dark"] .pm-settings-ewq-section .queue-sub-chip.is-on {
  background: rgba(233, 42, 44, 0.12);
  border-color: #e92a2c;
  color: #ff8a8c;
}

html[data-theme="dark"] .pm-settings-ewq-section .queue-sub-section-title,
html[data-theme="dark"] .pm-settings-ewq-section .ewq-nav-hint {
  color: #bfbfbf;
}

html[data-theme="dark"] .pm-settings-ewq-section .ewq-nav-hint a {
  color: #ff8a8c;
}

html[data-theme="dark"] .pm-settings-ewq-section .ewq-btn-ghost {
  background: #2a2a2a;
  border-color: #505050;
  color: #e6e6e6;
}

@media (min-width: 840px) {
  .pm-settings-page {
    max-width: 880px;
  }

  html.pm-settings-from-ewq .pm-settings-page,
  body.pm-settings-from-ewq .pm-settings-page {
    max-width: none;
  }
}

.pm-settings-subscriptions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pm-settings-sub-title {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted, #666);
  margin-bottom: 8px;
  font-weight: 700;
}

.pm-settings-sub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pm-settings-sub-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line2, #dcdcdc);
  background: var(--tint, #fafaf9);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius, 6px);
}

.pm-settings-sub-chip.is-on {
  background: rgba(233, 42, 44, 0.08);
  border-color: #E92A2C;
  color: #A71F23;
  font-weight: 600;
}

.pm-settings-sub-chip input {
  margin: 0;
  pointer-events: none;
}
