/* CSP Step 1: move static inline CSS from index.html into external stylesheet. */

/* Pro-gated sections are visible to all, but become read-only unless the plan allows Pro editing. */
.pfs-pro-locked [data-pro-gated="1"] a.pfs-link-disabled {
  pointer-events: none;
  opacity: 0.65;
  text-decoration: none;
}

/* Launch lock: Pro-gated cards are not expandable for non-Pro users */
.pfs-pro-locked details[data-pro-gated="1"] > summary {
  cursor: not-allowed;
}

.pfs-pro-locked details[data-pro-gated="1"] > summary .collapse-indicator {
  opacity: 0.25;
}

.opt-usage-note {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.7);
}

.card-title-with-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pro-meta {
  display: inline-flex;
  align-items: center;
}

.pfs-pro-locked .pro-meta {
  display: none;
}

.pill-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

/* Show a lock icon next to Pro pills for non-Pro users */
.pfs-pro-lock-icon {
  display: none;
  font-size: 12px;
  line-height: 1;
  opacity: 0.85;
}

.pfs-pro-locked .pfs-pro-lock-icon {
  display: inline-flex;
}

/* Plan badge (shows current plan next to the hamburger; demo already has its own badge) */
.pfs-plan-badge {
  margin-left: 0 !important;
  margin-right: 10px;
}

/* Hamburger menu items that are Pro-locked are still visible, but look disabled */
.pfs-pro-menu-locked {
  opacity: 0.65;
}

.pfs-pro-menu-locked::after {
  content: " \1F512";
}

.build-cutplan-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

/* Hide Cut Sheet button (if present now or later) */
#cutSheetBtn,
#btnCutSheet,
.btn-cut-sheet,
.cut-sheet-btn,
[data-action="cut-sheet"] {
  display: none !important;
}

/* Former inline styles from index.html */
#pfsHistoryCard[data-hidden="1"] {
  display: none;
}

.pfs-history-actions {
  padding: 10px 14px 14px;
  display: flex;
  justify-content: flex-end;
}

.fy-check-strong {
  font-weight: 900;
}

.fy-form-grid-mt10 {
  margin-top: 10px;
}

.settings-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.settings-header-row h2 {
  margin: 0;
}

.settings-header-row .fy-mini {
  margin-top: 4px;
}

.jobmgr-backlink {
  margin-left: 12px;
  text-decoration: none;
  font-weight: 900;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* Auth gate moved off inline styles */
.pfs-auth-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.pfs-auth-logout-btn {
  display: none;
}

.pfs-auth-panel-hidden {
  display: none;
}

.pfs-auth-row-mt10 {
  margin-top: 10px;
}

/* Windows summary moved off inline styles */
.pfs-summary-group-wrap {
  position: relative;
}

.pfs-group-rename-btn {
  position: absolute;
  left: -26px;
  top: 22px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
}

/* Account page moved off inline styles */
.account-msg {
  display: none;
  margin-bottom: 12px;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.account-msg-visible {
  display: block;
}

.account-msg-error {
  color: #ef4444;
}

.account-msg-success {
  color: #22c55e;
}

.account-msg-info {
  color: var(--text);
}

.account-section-title {
  margin-top: 10px;
  margin-bottom: 10px;
}

.account-section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-section-title-text {
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.account-section-sub {
  margin-top: 4px;
}

.account-hr {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.account-tier-badge {
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
}

.account-col {
  flex: 1 1 360px;
  min-width: 280px;
}

.account-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-row-top {
  margin-top: 12px;
  align-items: center;
}

.account-two-col {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  width: 100%;
  align-items: flex-start;
}

.account-save-row {
  margin-top: 12px;
  align-items: center;
  justify-content: flex-end;
}

.account-save-hint {
  margin-left: 8px;
}

/* Settings utility classes moved off inline styles */
.fy-mt12 {
  margin-top: 12px;
}

.fy-mt10 {
  margin-top: 10px;
}

.fy-row-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fy-m14-0 {
  margin: 14px 0;
}

.fy-mt8 {
  margin-top: 8px;
}

.fy-m16-0 {
  margin: 16px 0;
}

.fy-grid-full {
  grid-column: 1 / -1;
}

.fy-spacer-inline-8 {
  width: 8px;
  display: inline-block;
}

/* Optimization page CSP cleanup */
.rollfit-banner-notice-warn {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.rollfit-banner-notice-label {
  color: #f59e0b;
}

.fy-actions-inline {
  display: flex;
  gap: 10px;
}

.fy-actions-btn {
  flex: 1;
  width: 100%;
}

.pfs-optid-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 900;
}

.pfs-optid-code-medium {
  font-weight: 800;
}

.pfs-copy-optid-btn {
  padding: 0 6px;
  font-size: 12px;
  border: none;
  background: transparent;
  color: var(--primary, #2563eb);
  font-weight: 900;
  cursor: pointer;
}

.pfs-copy-optid-status {
  margin-left: 6px;
  font-weight: 900;
  color: #16a34a;
  opacity: 0;
  transition: opacity 0.2s;
}

.pfs-copy-optid-status-wide {
  margin-left: 8px;
}

.fy-plan-rollcard-dim {
  opacity: 0.7;
}

.fy-plan-unused-mt14 {
  margin-top: 14px;
}

.fy-plan-unused-title {
  font-weight: 900;
  margin: 0 0 8px 2px;
  opacity: 0.8;
}

.fy-hidden {
  display: none;
}

.fy-width-chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fy-finish-actions-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.fy-finish-metrics-card {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.fy-minw-0 {
  min-width: 0;
}

.fy-text-right {
  text-align: right;
}

.fy-metric-label {
  font-size: 11px;
  opacity: 0.75;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.fy-metric-value {
  font-size: 14px;
  font-weight: 900;
}

.fy-width-chip {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.04);
  font-weight: 800;
  cursor: pointer;
}

.fy-width-chip.is-selected {
  border-color: rgba(37, 99, 235, 0.6);
  background: rgba(37, 99, 235, 0.1);
}

.fy-width-chip:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fy-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 1000;
}

.fy-tab-locked {
  opacity: 0.55;
}

.fy-opt-loading {
  text-align: center;
  padding: 18px;
}

.fy-opt-loading-msg {
  margin-top: 10px;
  font-weight: 900;
}

.fy-opt-loading-sub {
  color: #64748b;
  font-weight: 700;
}

.fy-error-strong {
  font-weight: 900;
}

.fy-hint-tight {
  font-size: 13px;
  line-height: 1.45;
}

.fy-ul-tight {
  margin: 8px 0 0 18px;
  padding: 0;
  line-height: 1.5;
}

.fy-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fy-overall-eff {
  font-size: 12px;
  font-weight: 900;
  color: #64748b;
}

.fy-plan-meta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-weight: 900;
  margin-top: 6px;
}

.fy-eff-green {
  color: #16a34a;
}

.fy-opt-actions-end {
  justify-content: flex-end;
}

.fy-mt6 {
  margin-top: 6px;
}

.fy-roll-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.fy-roll-summary-title {
  font-weight: 900;
}

.fy-roll-summary-meta {
  display: flex;
  gap: 12px;
  font-weight: 800;
  color: #64748b;
}

@media (max-width: 640px) {
  .mobile-optimize-bar {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .mobile-optimize-bar .btn-mobile-optimize {
    width: 100%;
  }

  .mobile-optimize-bar .opt-usage-note-mobile {
    text-align: center;
    margin-top: 0;
  }
}
