/* DYNAMIC STYLING CLASSES — Replacing .style assignments for CSP compliance */

/* Error/status message colors */
.eco-msg-error {
  color: var(--color-accent-r);
}

.eco-msg-success {
  color: var(--color-accent-g);
}

.eco-msg-info {
  color: var(--color-accent-c);
}

/* Help button (fixed position) */
.eco-help-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent-g); /* S320: was using hardcoded green, now token — use green to distinguish from theme btn */
  color: var(--color-accent-g-fg);
  font-family: Arial Black, Arial, sans-serif;
  font-size: 22px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 204, 68, 0.35); /* green glow */
  transition: transform 0.15s;
  border: 2px solid rgba(255,255,255,.5);
  padding: 0;
}

.eco-help-button:hover {
  transform: scale(1.1);
}

.eco-help-button:active {
  transform: scale(1);
}

/* Help panel (fixed position) */
.eco-help-panel {
  position: fixed;
  bottom: 134px;
  right: 20px;
  z-index: 9998;
  width: 340px;
  max-height: min(480px, calc(100vh - 160px));
  background: var(--color-surface, var(--color-surface));
  border: 1px solid rgba(0, 170, 255, 0.25);
  border-radius: 14px;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: none;
  overflow: hidden;
  color: var(--color-text);
}

@media (max-width: 480px) {
  .eco-help-panel {
    bottom: auto;
    top: 70px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 90px);
    border-radius: 10px;
  }
}

.eco-help-panel.visible {
  display: block;
}

/* Help wrap/container */
.eco-help-wrap {
  position: fixed;
  bottom: 60px;
  right: 16px;
  z-index: 999;
  background: var(--color-surface);
  border: 1px solid var(--color-accent-c-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--color-text);
}

/* Help category buttons */
.eco-help-cat {
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-mid);
  transition: all 0.15s;
}

.eco-help-cat:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.eco-help-cat.active,
.eco-help-cat-active {
  border-color: var(--color-accent-c);
  color: var(--color-accent-c);
  background: rgba(0, 170, 255, 0.08);
}

/* Footer styling */
.eco-footer {
  max-width: 800px;
  margin: 40px auto 0;
  padding: 24px 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: var(--color-text-dim);
}

/* Toggle visibility */
.eco-hidden {
  display: none !important;
}

.eco-visible {
  display: block !important;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* HELP PANEL — Help Center sections extracted from inline styles */
/* ═══════════════════════════════════════════════════════════════════ */

.eco-help-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.eco-help-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eco-help-title {
  font-family: Arial Black, Arial, sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: var(--color-accent-c);
}

.eco-help-close {
  cursor: pointer;
  font-size: 18px;
  color: var(--color-text-mid);
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}

.eco-help-close:hover {
  color: var(--color-text-mid);
}

.eco-help-subtitle {
  font-size: 11px;
  color: var(--color-text-mid);
  margin-top: 4px;
}

.eco-help-body {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: 360px;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
  .eco-help-body {
    max-height: calc(100vh - 210px);
  }
}

.eco-help-tour {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: rgba(0, 204, 68, 0.06);
  border: 1px solid rgba(0, 204, 68, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
  text-decoration: none;
}

.eco-help-tour:hover {
  border-color: rgba(0, 204, 68, 0.4);
}

/* FAQ browse link — same shape as tour, cyan accent */
.eco-help-faq-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: var(--color-accent-c-subtle);
  border: 1px solid rgba(0, 170, 255, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
  text-decoration: none;
}
.eco-help-faq-link:hover { border-color: rgba(0, 170, 255, 0.4); }
.eco-help-faq-link .eco-help-tour-label { color: var(--color-accent-c); }
.eco-help-faq-icon { font-size: 16px; }

.eco-help-tour-icon {
  font-size: 16px;
}

.eco-help-tour-text {
  flex: 1;
}

.eco-help-tour-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-accent-g);
}

.eco-help-tour-desc {
  font-size: 10px;
  color: var(--color-text-mid);
}

.eco-help-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.eco-help-cat-item {
  padding: 5px 10px;
  font-size: 11px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--color-text-mid);
  transition: all 0.15s;
  background: transparent;
}

.eco-help-cat-item:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.eco-help-cat-item.active {
  border-color: var(--color-accent-c);
  color: var(--color-accent-c);
  background: rgba(0, 170, 255, 0.08);
}

.eco-help-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 80px;
  background: var(--color-bg, var(--color-bg));
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--color-text, #e6edf3);
  font-size: 13px;
  font-family: Arial, Helvetica, sans-serif;
  resize: vertical;
  outline: none;
}

.eco-help-textarea::placeholder {
  color: var(--color-text-mid);
}

.eco-help-submit {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--color-accent-g);
  color: var(--color-accent-g-fg);
  font-family: Arial Black, Arial, sans-serif;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s;
}

.eco-help-submit:hover {
  background: var(--color-accent-g);
}

.eco-help-submit:active {
  background: var(--color-accent-g);
}

.eco-help-msg {
  font-size: 11px;
  margin-top: 8px;
  color: var(--color-text-mid);
  min-height: 16px;
}

/* Help panel success message */
.eco-help-success {
  text-align: center;
  padding: 30px 0;
}

.eco-help-success-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.eco-help-success-ticket {
  font-family: Arial Black, Arial, sans-serif;
  font-size: 16px;
  color: var(--color-accent-g);
  margin-bottom: 6px;
}

.eco-help-success-text {
  font-size: 12px;
  color: var(--color-text-mid);
  line-height: 1.6;
}

.eco-help-success-close {
  margin-top: 16px;
  color: var(--color-accent-c);
  font-size: 12px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: none;
}

.eco-help-success-close:hover {
  color: var(--color-accent-c);
}

/* ═══════════════════════════════════════════════════════════════════ */
/* HEADER — Triangle icon, avatar, network switcher */
/* ═══════════════════════════════════════════════════════════════════ */

.eco-tri-icon {
  width: 26px;
  height: 24px;
  flex-shrink: 0;
}

.eco-signin-link {
  color: var(--color-accent-c);
  font-weight: 600;
  text-decoration: none;
}

.eco-signin-link:hover {
  color: var(--color-accent-c);
}

.eco-avatar-photo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 25%;
  position: absolute;
  inset: 0;
}

.eco-tier-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-accent-c) 15%, transparent);
  color: var(--color-accent-c);
  margin-left: 6px;
  vertical-align: middle;
}

.eco-avatar-wrap {
  position: relative;
}

.eco-avatar-wrap.has-photo {
  background: none !important;
}

.eco-hr-small {
  margin: 4px 0;
  border: none;
  border-top: 1px solid var(--color-border);
}

/* Network switcher */
.eco-net-label {
  color: var(--color-text-mid);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.eco-net-current {
  color: var(--color-accent-c);
  font-weight: 700;
  cursor: default;
  padding: 3px 0;
}

.eco-net-item {
  color: var(--color-text-mid);
  cursor: pointer;
  padding: 3px 0;
  text-decoration: none;
  transition: color 0.15s;
}

.eco-net-item:hover {
  color: var(--color-accent-c);
}

.eco-net-add {
  margin-top: 8px;
  padding: 4px 0;
  color: var(--color-accent-g);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 8px;
  transition: color 0.15s;
}
.eco-net-add:hover { color: var(--color-accent-c); }

/* ═══════════════════════════════════════════════════════════════════ */
/* FOOTER — Links and metadata */
/* ═══════════════════════════════════════════════════════════════════ */

.eco-footer-links {
  display: flex;
  gap: 16px;
}

.eco-footer-link {
  color: var(--color-text-dim);
  text-decoration: none;
  transition: color 0.15s;
  font-size: 11px;
}

.eco-footer-link:hover {
  color: var(--color-text);
}

/* Live offline indicator (shown only when navigator is actually offline) — S245 */
.eco-offline-banner {
  background: rgba(0, 204, 68, 0.1);
  border: 1px solid var(--color-accent-g-border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--color-text-mid);
}
.eco-offline-banner-icon { font-size: 1.2rem; }

/* ════════════════════════════════════════════════════════════════════
   S254 CSP — utility classes replacing inline on* handlers under strict
   script-src 'self'. Hover states (was onmouseover/onmouseout) + display
   toggles for the global img-error fallback in user-dispatch.js.
   ════════════════════════════════════════════════════════════════════ */
.eco-dn { display: none !important; }
.eco-df { display: flex !important; }
.eco-hov-surf2:hover   { background: var(--color-surface2); }
.eco-hov-acc08:hover   { background: rgba(0, 170, 255, .08); }
.eco-hov-acc10:hover   { background: rgba(0, 170, 255, 0.1); }
.eco-hov-op1:hover     { opacity: 1 !important; }
.eco-hov-bordacc:hover { border-color: var(--color-accent-c) !important; }
.eco-hov-del:hover     { color: var(--color-accent-r) !important; border-color: var(--color-accent-r) !important; }

/* ── Global eco-print toolbar position — above Help button ──── */
/* Help at bottom:20px (44px tall → top:64px)                   */
/* Print at bottom:80px (clear 16px above help top)             */
.eco-print-toolbar { bottom: 80px !important; right: 20px !important; }

/* S304: CSP inline-style removals — shared page classes */
.eco-section-eyebrow { font-family: 'Arial Black', Arial, sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.eco-data-heading    { font-family: 'Arial Black', Arial, sans-serif; font-weight: 900; font-size: 1.6rem; color: var(--color-text); margin-bottom: 6px; }
.eco-cat-label       { font-size: 12px; font-family: 'Arial Black', Arial, sans-serif; font-weight: 900; letter-spacing: .08em; color: var(--color-text-dim); text-transform: uppercase; margin-bottom: 8px; }
.eco-note-dim        { font-size: 11px; color: var(--color-text-dim); }

/* ════════════════════════════════════════════════════════════════════
   S324 — Help widget contrast in LIGHT themes (grove/parchment).
   The panel bg is var(--color-surface) (cream in parchment), but the text
   colors were light-on-light → white-on-cream.
   Flip text to theme-aware vars only for the light themes; dark themes
   (void/deep-sea) keep their correct white text.
   ════════════════════════════════════════════════════════════════════ */
[data-theme="grove"] .eco-help-subtitle,
[data-theme="parchment"] .eco-help-subtitle,
[data-theme="grove"] .eco-help-tour-desc,
[data-theme="parchment"] .eco-help-tour-desc,
[data-theme="grove"] .eco-help-cat-item,
[data-theme="parchment"] .eco-help-cat-item,
[data-theme="grove"] .eco-help-textarea::placeholder,
[data-theme="parchment"] .eco-help-textarea::placeholder {
  color: var(--color-text-dim) !important;
}
[data-theme="grove"] .eco-help-close,
[data-theme="parchment"] .eco-help-close,
[data-theme="grove"] .eco-help-cat-item:hover,
[data-theme="parchment"] .eco-help-cat-item:hover {
  color: var(--color-text) !important;
}
[data-theme="grove"] .eco-help-title,
[data-theme="parchment"] .eco-help-title,
[data-theme="grove"] .eco-help-cat-item.active,
[data-theme="parchment"] .eco-help-cat-item.active {
  color: var(--color-accent-c) !important;
}
[data-theme="grove"] .eco-help-tour-label,
[data-theme="parchment"] .eco-help-tour-label {
  color: var(--color-accent-g) !important;
}
[data-theme="grove"] .eco-help-cat-item,
[data-theme="parchment"] .eco-help-cat-item {
  border-color: var(--color-border, rgba(0,0,0,0.18)) !important;
}
[data-theme="grove"] .eco-help-cat-item.active,
[data-theme="parchment"] .eco-help-cat-item.active {
  border-color: var(--color-accent-c) !important;
}
/* S359: pf-ep-dashboard type-A burn-down */
.ep-stat-g   { color:var(--color-accent-g); }
.ep-stat-a   { color:var(--color-accent-a); }
.ep-stat-p   { color:var(--eco-violet); }
.ep-label-sm { font-size:0.78rem; color:var(--color-text-dim); }
.ep-label-sm2{ font-size:0.85rem; color:var(--color-text-dim); }
.ep-ml12     { margin-left:12px; }
.ep-pad40-c  { padding:40px 20px; text-align:center; color:var(--color-text-dim); }

/* S391 — eco-help panel + eco-net switcher light theme contrast */
html[data-theme="grove"] .eco-help-wrap,
html[data-theme="parchment"] .eco-help-wrap,
html[data-theme="grove"] .eco-help-panel,
html[data-theme="parchment"] .eco-help-panel {
  background: var(--brand-white) !important;
  color: var(--color-text) !important; /* S449: color-bg is near-white on light themes → use color-text */
  border-color: rgba(0,0,0,0.18) !important;
}
html[data-theme="grove"] .eco-help-close,
html[data-theme="parchment"] .eco-help-close,
html[data-theme="grove"] .eco-help-subtitle,
html[data-theme="parchment"] .eco-help-subtitle,
html[data-theme="grove"] .eco-help-tour-desc,
html[data-theme="parchment"] .eco-help-tour-desc,
html[data-theme="grove"] .eco-help-msg,
html[data-theme="parchment"] .eco-help-msg,
html[data-theme="grove"] .eco-help-success-text,
html[data-theme="parchment"] .eco-help-success-text,
html[data-theme="grove"] .eco-help-cat,
html[data-theme="parchment"] .eco-help-cat,
html[data-theme="grove"] .eco-help-cat-item,
html[data-theme="parchment"] .eco-help-cat-item {
  color: rgba(0,0,0,0.65) !important;
}
html[data-theme="grove"] .eco-help-cat.active,
html[data-theme="parchment"] .eco-help-cat.active,
html[data-theme="grove"] .eco-help-cat-active,
html[data-theme="parchment"] .eco-help-cat-active {
  color: var(--color-accent-c) !important;
  border-color: var(--color-accent-c) !important;
}
html[data-theme="grove"] .eco-help-textarea,
html[data-theme="parchment"] .eco-help-textarea {
  background: rgba(0,0,0,0.04) !important;
  color: var(--color-bg) !important;
  border-color: rgba(0,0,0,0.14) !important;
}
/* eco-net old switcher (header.js) */
html[data-theme="grove"] .eco-net-label,
html[data-theme="parchment"] .eco-net-label,
html[data-theme="grove"] .eco-net-item,
html[data-theme="parchment"] .eco-net-item {
  color: rgba(0,0,0,0.55) !important;
}
