.flm-container {
  position: relative;   /* positioning context for the plan-picker modal (kept inside the meter) */
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 20px;
  text-align: center;
  font-family: 'Open Sans', sans-serif;
  color: #ffffff;
}

/* Auth bar */
.flm-auth-bar {
  text-align: right;
  margin-bottom: 20px;
}

.flm-btn-auth {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  background: transparent;
  border: 1px solid #555;
  border-radius: 4px;
  color: #ccc;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  padding: 6px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.flm-btn-auth:hover {
  border-color: #40E0D0;
  color: #40E0D0;
}

.flm-btn-auth-purchase {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  background: #D4A843;
  border: none;
  border-radius: 4px;
  color: #0a0a0a;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  margin-right: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.flm-btn-auth-purchase:hover {
  background: #e8c45a;
}

.flm-btn-auth-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: #666;
  text-decoration: none;
  margin-right: 14px;
  cursor: pointer;
  transition: color 0.2s;
}

.flm-btn-auth-secondary:hover {
  color: #40E0D0;
}

/* Material icon sizing inside the auth-bar buttons (font is 13px; nudge the icon to match). */
.flm-auth-bar .material-icons {
  font-size: 16px;
  line-height: 1;
}

.flm-auth-user-info {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #888;
}

.flm-auth-user-info .flm-user-email {
  color: #ccc;
}

.flm-auth-user-info .flm-badge-pro {
  background: #D4A843;
  color: #0a0a0a;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
}

.flm-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  color: #ffffff;
}

.flm-badge-tier {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  vertical-align: middle;
  letter-spacing: 1px;
  margin-left: 8px;
}

.flm-badge-tier.free {
  background: #333;
  color: #888;
}

.flm-badge-tier.plus {
  background: #D4A843;
  color: #0a0a0a;
}

.flm-subtitle {
  font-size: 20px;
  font-weight: 400;
  color: #aaa;
  margin-bottom: 40px;
}

/* File select button */
.flm-file-select {
  display: inline-block;
  position: relative;
  cursor: pointer;
  border: 2px solid #40E0D0;
  border-radius: 6px;
  padding: 14px 40px;
  font-size: 18px;
  color: #40E0D0;
  transition: background 0.2s, color 0.2s;
  overflow: hidden;
}

.flm-file-select:hover {
  background: rgba(64, 224, 208, 0.1);
}

.flm-file-select:active {
  background: rgba(64, 224, 208, 0.2);
}

.flm-file-select.flm-drag-over {
  background: rgba(64, 224, 208, 0.15);
  border-style: dashed;
}

.flm-file-select input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Status line */
.flm-status {
  margin-top: 20px;
  font-size: 14px;
  color: #888;
  min-height: 20px;
}

.flm-spinner-inline {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #40E0D0;
  border-top-color: transparent;
  border-radius: 50%;
  animation: flm-spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes flm-spin {
  to { transform: rotate(360deg); }
}

/* Export buttons */
.flm-export-buttons {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.flm-btn-export {
  background: transparent;
  border: 1px solid #555;
  border-radius: 4px;
  color: #ccc;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  padding: 6px 18px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.flm-btn-export:hover {
  border-color: #40E0D0;
  color: #40E0D0;
}

/* Results list */
.flm-results {
  margin-top: 30px;
  text-align: left;
}

.flm-result-card {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

.flm-result-card .flm-file-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 10px;
  word-break: break-word;
}

.flm-result-card .flm-values {
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
}

.flm-result-card .flm-value-item {
  flex: 1;
  min-width: 0;
}

.flm-result-card .flm-value-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.flm-result-card .flm-value-number {
  font-size: 18px;
  font-weight: 700;
  color: #40E0D0;
}

.flm-result-card .flm-value-unit {
  font-size: 11px;
  font-weight: 400;
}

.flm-result-card .flm-value-locked .flm-value-number {
  font-size: 13px;
  font-weight: 400;
  color: #D4A843;
}

.flm-pending-eta {
  font-weight: 400;
  font-size: 12px;
  color: #888;
  margin-left: 8px;
}

.flm-value-placeholder {
  color: #444 !important;
}

.flm-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #2a2a2a;
}

.flm-progress-bar-fill {
  height: 100%;
  background: #40E0D0;
  width: 0%;
  transition: width 0.25s linear;
}

.flm-result-card-error {
  border-left: 3px solid #e05555;
}

.flm-result-card-error .flm-error-message {
  font-size: 13px;
  color: #e05555;
}

.flm-unlock-link {
  color: #D4A843;
  text-decoration: none;
  transition: color 0.2s;
}

.flm-unlock-link:hover {
  color: #e8c45a;
}

/* Upgrade banner */
.flm-upgrade-banner {
  margin-top: 40px;
  text-align: center;
}

.flm-upgrade-banner-link {
  display: inline-block;
  color: #D4A843;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 24px;
  border: 1px solid #D4A843;
  border-radius: 6px;
  background: #1a1a1a;
  transition: background 0.2s, color 0.2s;
}

.flm-upgrade-banner-link:hover {
  background: rgba(212, 168, 67, 0.15);
  color: #e8c45a;
}

/* Plan picker popup */
.flm-plan-modal {
  position: absolute;      /* contained inside .flm-container (the meter), NOT the page viewport — so it
                              never collides with the site header / iOS status bar */
  top: 0;
  left: 0;
  right: 0;
  min-height: 100%;        /* fill the meter, and GROW with the card so it never needs a scrollbar */
  z-index: 10000;
  display: none;           /* toggled to flex by openCheckout() */
  align-items: flex-start; /* card sits at the top (margin:auto below centres it when there's room) */
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  padding: 20px;
  font-family: 'Open Sans', sans-serif;
}

.flm-plan-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: auto;            /* vertical-centre when there's room; lets the overlay scroll when there isn't */
  background: #121212;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 32px 28px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.flm-plan-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}

.flm-plan-close:hover {
  color: #fff;
}

.flm-plan-heading {
  margin: 0 0 6px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.flm-plan-subheading {
  margin: 0 0 26px;
  color: #999;
  font-size: 14px;
}

.flm-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.flm-plan-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 24px 16px 20px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}

.flm-plan-option:hover {
  border-color: #40E0D0;
  transform: translateY(-3px);
}

.flm-plan-featured {
  border-color: #D4A843;
  background: #1d1a12;
}

.flm-plan-featured:hover {
  border-color: #e8c45a;
}

.flm-plan-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: #D4A843;
  color: #0a0a0a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* "Current plan" badge — hidden until the card is marked as the user's current plan. */
.flm-plan-current-badge {
  display: none;
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: #40E0D0;
  color: #042a26;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Current plan: turquoise treatment; its badge replaces the "Best value" badge. */
.flm-plan-current {
  border-color: #40E0D0;
  background: #0f1c1b;
}

.flm-plan-current:hover {
  border-color: #40E0D0;
}

.flm-plan-current .flm-plan-badge {
  display: none;
}

.flm-plan-current .flm-plan-current-badge {
  display: block;
}

.flm-plan-current .flm-plan-buy,
.flm-plan-current:hover .flm-plan-buy {
  background: transparent;
  border-color: #40E0D0;
  color: #40E0D0;
}

.flm-plan-name {
  color: #ccc;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.flm-plan-price {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  min-height: 31px;
}

.flm-plan-period {
  color: #888;
  font-size: 12px;
  margin-top: 4px;
  margin-bottom: 18px;
}

.flm-plan-buy {
  width: 100%;
  margin-top: auto;
  background: transparent;
  border: 1px solid #555;
  border-radius: 6px;
  color: #fff;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.flm-plan-option:hover .flm-plan-buy {
  border-color: #40E0D0;
  color: #40E0D0;
}

.flm-plan-featured .flm-plan-buy {
  background: #D4A843;
  border-color: #D4A843;
  color: #0a0a0a;
}

.flm-plan-featured:hover .flm-plan-buy {
  background: #e8c45a;
  border-color: #e8c45a;
  color: #0a0a0a;
}

/* Plan picker footer (manage purchases) */
.flm-plan-footer {
  margin-top: 22px;
  text-align: center;
}

.flm-plan-manage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #888;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}

.flm-plan-manage:hover {
  color: #40E0D0;
}

.flm-plan-footer .material-icons {
  font-size: 16px;
}

/* Post-purchase confirmation view */
#plan-confirm-view {
  text-align: center;
  padding: 8px 0 4px;
}

.flm-plan-confirm-icon {
  margin-bottom: 10px;
}

.flm-plan-confirm-icon .material-icons {
  font-size: 56px;
  color: #40E0D0;
}

.flm-plan-confirm-signin {
  margin: 18px auto 0;
}

/* Mobile */
@media (max-width: 600px) {
  .flm-result-card .flm-values {
    flex-direction: column;
    gap: 10px;
  }

  .flm-plan-grid {
    grid-template-columns: 1fr;
  }

  .flm-plan-card {
    padding: 28px 18px 20px;
  }
}
