:root {
  --bg: #040406;
  --surface: rgba(15, 15, 21, 0.74);
  --surface-strong: rgba(22, 22, 32, 0.94);
  --border: rgba(255, 255, 255, 0.09);
  --border-bright: rgba(255, 255, 255, 0.22);
  --text: #f5f5f7;
  --muted: #8e8e9c;
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
button, input { outline: none; font-family: inherit; }
button:focus-visible { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  background: radial-gradient(circle at 50% 0%, #101019 0%, var(--bg) 62%);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

.app-shell { height: 100vh; display: flex; flex-direction: column; justify-content: space-between; padding: 12px 18px 16px; gap: 10px; }

.glass {
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.top-bar { display: flex; align-items: center; justify-content: space-between; padding: 9px 15px; border-radius: var(--radius); gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.85); }
.brand-name { font-weight: 700; letter-spacing: 0.12em; font-size: 14px; }
.brand-name span { color: var(--muted); font-weight: 500; }
.brand-tag { font-size: 10px; letter-spacing: 0.08em; color: var(--muted); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; }
.brand-tag.is-pro { color: #10b981; border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.1); }

.top-center { display: flex; align-items: center; gap: 8px; }
.segmented { display: flex; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.seg-btn { background: transparent; border: none; color: var(--muted); font-size: 12px; font-weight: 500; padding: 6px 11px; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: rgba(255, 255, 255, 0.14); color: var(--text); }

.top-actions { display: flex; align-items: center; gap: 8px; }
.seed-chip { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); color: var(--muted); font-size: 11px; padding: 7px 10px; border-radius: 10px; cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; transition: border-color 0.2s; }
.seed-chip:hover { border-color: var(--border-bright); color: var(--text); }
.seed-chip strong { color: var(--text); }

.btn-reel { display: flex; align-items: center; gap: 6px; background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.32); color: #fca5a5; font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 10px; cursor: pointer; transition: all 0.2s ease; }
.btn-reel:hover { background: rgba(239, 68, 68, 0.22); color: #fff; }
.btn-reel:disabled { opacity: 0.5; cursor: wait; }
.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 8px #ef4444; }

.btn-ghost, .btn-primary { font-size: 12px; font-weight: 600; padding: 8px 13px; border-radius: 10px; cursor: pointer; transition: transform 0.15s ease, opacity 0.2s ease; }
.btn-ghost { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--border); color: var(--text); }
.btn-primary { background: #fff; border: 1px solid #fff; color: #050507; box-shadow: 0 0 24px rgba(255, 255, 255, 0.2); }
.btn-ghost:hover, .btn-primary:hover { transform: translateY(-1px); opacity: 0.92; }

.stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; }
.canvas-frame { position: relative; border-radius: 22px; overflow: hidden; border: 1px solid var(--border-bright); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85); transition: width 0.35s ease, height 0.35s ease, border-radius 0.3s ease; background: #000; }
.canvas-frame.ratio-phone { height: min(61vh, 550px); aspect-ratio: 9 / 16; }
.canvas-frame.ratio-desktop { width: min(72vw, 880px); max-height: 59vh; aspect-ratio: 16 / 9; }
.canvas-frame.ratio-square { height: min(59vh, 510px); aspect-ratio: 1 / 1; }
.canvas-frame.mockup-active.ratio-phone { border-radius: 40px; border: 6px solid #1b1b22; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 35px 90px rgba(0, 0, 0, 0.9); }
.canvas-frame.mockup-active.ratio-desktop { border-radius: 16px; border: 4px solid #1c1c24; }

#stageCanvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#stageCanvas:active { cursor: grabbing; }

.drag-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.78); font-size: 11px; padding: 5px 12px; border-radius: 999px; pointer-events: none; white-space: nowrap; transition: opacity 0.4s ease; }
.drag-hint.hidden { opacity: 0; }

.rec-badge { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 7px; background: rgba(15, 5, 8, 0.8); border: 1px solid rgba(239, 68, 68, 0.55); color: #fecaca; font-size: 11px; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: 5px 10px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.rec-badge.active { opacity: 1; }
.rec-pulse { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: pulse 0.9s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }

.mockup-overlay { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.25s ease; }
.canvas-frame.mockup-active.ratio-phone .phone-overlay { opacity: 1; }
.canvas-frame.mockup-active.ratio-desktop .desktop-overlay { opacity: 1; }

.phone-overlay { display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 14px 20px 12px; }
.dynamic-island { width: 78px; height: 22px; background: #000; border-radius: 999px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }
.lock-header { text-align: center; margin-top: -175px; text-shadow: 0 4px 22px rgba(0, 0, 0, 0.45); }
.lock-date { font-size: 12px; font-weight: 500; opacity: 0.88; }
.lock-time { font-size: 54px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.lock-bottom { width: 100%; display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 4px; }
.lock-icon { width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(10px); display: grid; place-items: center; font-size: 13px; }
.home-bar { width: 96px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.85); }

.desktop-overlay { display: flex; flex-direction: column; justify-content: space-between; }
.desk-menubar { height: 24px; background: rgba(10, 10, 14, 0.45); backdrop-filter: blur(16px); display: flex; justify-content: space-between; align-items: center; padding: 0 14px; font-size: 11px; font-weight: 500; }
.desk-dock { align-self: center; margin-bottom: 10px; padding: 7px 14px; border-radius: 16px; background: rgba(20, 20, 28, 0.48); backdrop-filter: blur(18px); border: 1px solid rgba(255, 255, 255, 0.14); display: flex; gap: 10px; }
.dock-dot { width: 24px; height: 24px; border-radius: 7px; background: rgba(255, 255, 255, 0.16); }
.dock-dot.active-dot { background: linear-gradient(135deg, #fff, #8b5cf6); }

.control-dock { border-radius: 20px; padding: 13px 16px; display: flex; flex-direction: column; gap: 12px; }
.dock-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.control-group { display: flex; flex-direction: column; gap: 6px; }
.group-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
.pills { display: flex; gap: 5px; flex-wrap: wrap; }
.pill { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); color: var(--muted); font-size: 11.5px; font-weight: 500; padding: 6px 10px; border-radius: 9px; cursor: pointer; transition: all 0.2s ease; }
.pill:hover { color: var(--text); border-color: var(--border-bright); }
.pill.active { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.35); color: var(--text); }

.swatches { display: flex; gap: 7px; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: #fff; transform: scale(1.14); box-shadow: 0 0 14px rgba(255, 255, 255, 0.35); }

.btn-surprise { background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)); border: 1px solid var(--border-bright); color: var(--text); font-size: 12px; font-weight: 600; padding: 8px 14px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 7px; transition: all 0.2s ease; }
.btn-surprise:hover { background: rgba(255, 255, 255, 0.18); transform: translateY(-1px); }
.btn-surprise kbd { font-size: 10px; color: var(--muted); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; }

.sliders-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-top: 9px; border-top: 1px solid var(--border); }
.slider-item { display: flex; flex-direction: column; gap: 5px; }
.slider-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.slider-head span:last-child { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
input[type="range"] { -webkit-appearance: none; width: 100%; height: 4px; background: rgba(255, 255, 255, 0.14); border-radius: 99px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; cursor: pointer; box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(8px); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity 0.22s ease; z-index: 80; padding: 20px; }
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal-card { width: min(430px, 100%); border-radius: 22px; padding: 24px; position: relative; background: rgba(14, 14, 20, 0.94); border: 1px solid var(--border-bright); transform: scale(0.96); transition: transform 0.22s ease; }
.modal-backdrop.open .modal-card { transform: scale(1); }
.modal-close { position: absolute; top: 16px; right: 16px; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); color: var(--muted); cursor: pointer; }
.modal-close:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
.modal-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: #c4b5fd; background: rgba(139, 92, 246, 0.16); border: 1px solid rgba(139, 92, 246, 0.35); padding: 4px 10px; border-radius: 999px; margin-bottom: 12px; }
.pro-active-badge { color: #6ee7b7; background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.38); }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.4; }
.pricing-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(255, 255, 255, 0.04); padding: 4px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 16px; }
.region-btn { background: transparent; border: none; color: var(--muted); font-size: 12px; font-weight: 600; padding: 8px; border-radius: 9px; cursor: pointer; transition: all 0.2s; }
.region-btn.active { background: rgba(255, 255, 255, 0.14); color: #fff; }
.pro-features { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; font-size: 12.5px; color: #d4d4df; }
.modal-cta { width: 100%; padding: 11px; font-size: 13px; border-radius: 12px; }
.export-stack { display: flex; flex-direction: column; gap: 10px; }
.key-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; font-size: 11px; color: var(--muted); }
.key-divider::before, .key-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; color: #fff; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.key-row input:focus { border-color: var(--border-bright); }

.toast { position: fixed; top: 72px; left: 50%; transform: translateX(-50%) translateY(-12px); background: var(--surface-strong); border: 1px solid var(--border-bright); color: var(--text); font-size: 12px; font-weight: 500; padding: 9px 16px; border-radius: 999px; opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.canvas-frame.mockup-active .drag-hint { opacity: 0; }
.canvas-frame.mockup-active .drag-hint { opacity: 0; }
.canvas-frame.mockup-active .drag-hint { opacity: 0; }

/* Monetization Analyzer Card */
.analyzer-card {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 215px;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(10, 10, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  z-index: 15;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.canvas-frame.mockup-active .analyzer-card {
  opacity: 0;
}

.analyzer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.analyzer-title {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.analyzer-score {
  font-size: 11px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 1px 7px;
  border-radius: 999px;
}

.analyzer-offer {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.analyzer-tip {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.32;
}

/* Upgrade 1: Founder-Only Monetization Mode */
.analyzer-card { display: none; }
body.founder-mode .analyzer-card { display: block; pointer-events: auto; }
.analyzer-foot {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.analyzer-foot button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  cursor: pointer;
}
.analyzer-foot button:hover { background: rgba(255,255,255,0.2); }

/* Setups & Share Buttons */
.btn-setups {
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.38);
  color: #ddd6fe;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-setups:hover { background: rgba(139, 92, 246, 0.28); color: #fff; }
.btn-share { padding: 7px 11px; }

/* Presets Modal Grid */
.presets-card { width: min(680px, 100%); max-height: 84vh; overflow-y: auto; }
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
}
.preset-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.2s ease;
}
.preset-card:hover { transform: translateY(-2px); border-color: var(--border-bright); }
.preset-preview {
  height: 76px;
  padding: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}
.preset-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
}
.preset-meta { padding: 9px 10px; }
.preset-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.preset-style { font-size: 10px; color: var(--muted); text-transform: capitalize; }

/* Full Mobile & Tablet Responsive Polish */
@media (max-width: 900px) {
  body { height: auto; min-height: 100vh; overflow-y: auto; }
  .app-shell { height: auto; min-height: 100vh; padding: 10px 12px 24px; gap: 12px; }
  .top-bar { justify-content: center; padding: 10px 12px; }
  .top-center, .top-actions { flex-wrap: wrap; justify-content: center; }
  .stage { min-height: 360px; padding: 6px 0; }
  .canvas-frame.ratio-phone { height: 54vh; min-height: 340px; }
  .canvas-frame.ratio-desktop { width: 92vw; max-height: 45vh; }
  .canvas-frame.ratio-square { height: 74vw; max-height: 360px; }
  .sliders-row { grid-template-columns: 1fr; gap: 12px; }
  .dock-row { gap: 12px; }
  .seed-chip { display: none; }
}

/* Upgrade 2: Theme Department v1 */
.btn-themes {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.36);
  color: #a7f3d0;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-themes:hover { background: rgba(16, 185, 129, 0.26); color: #fff; }

.theme-modal-card { width: min(600px, 100%); }
.theme-swatch-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.theme-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}
.theme-dot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.22);
  flex-shrink: 0;
}
.theme-chip-k { font-size: 8.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.theme-chip-v { font-size: 10.5px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); }

.theme-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.theme-action-card {
  text-align: left;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease;
}
.theme-action-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-bright);
  background: rgba(255,255,255,0.07);
}
.ta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.ta-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.ta-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }
.ta-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 999px;
}
.ta-badge.free { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
.ta-badge.pro { background: rgba(139, 92, 246, 0.22); color: #ddd6fe; }
.ta-badge.ultra { background: rgba(16, 185, 129, 0.20); color: #6ee7b7; }

@media (max-width: 640px) {
  .theme-swatch-bar { grid-template-columns: repeat(2, 1fr); }
  .theme-actions-grid { grid-template-columns: 1fr; }
}

/* Upgrade 3: Tier Badges & Founder Command Center */
.brand-tag.plan-pro {
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(139, 92, 246, 0.55);
  color: #e9d5ff;
}
.brand-tag.plan-ultra {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(245, 158, 11, 0.25));
  border-color: rgba(52, 211, 153, 0.55);
  color: #a7f3d0;
}

.founder-fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(15, 15, 24, 0.92);
  border: 1px solid rgba(139, 92, 246, 0.55);
  color: #ede9fe;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
body.founder-mode .founder-fab { display: inline-flex; align-items: center; gap: 6px; }
.founder-fab:hover { background: rgba(139, 92, 246, 0.3); color: #fff; }

.founder-modal-card { width: min(640px, 100%); max-height: 86vh; overflow-y: auto; }
.fh-offer-banner {
  font-size: 11.5px;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 8px 11px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.fh-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 13px;
  margin-bottom: 12px;
}
.fh-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
}
.fh-mini-actions { display: flex; gap: 6px; }
.fh-mini-actions button, .fh-test-row button, .fh-key-result button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  font-size: 10.5px;
  padding: 4px 9px;
  border-radius: 7px;
  cursor: pointer;
}
.fh-mini-actions button:hover, .fh-test-row button:hover, .fh-key-result button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.fh-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fh-stat {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fh-k { font-size: 9.5px; color: var(--muted); }
.fh-stat strong { font-size: 13px; color: var(--text); }

.fh-sim-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.fh-sim-inputs label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
}
.fh-sim-inputs input, .fh-keygen-row select, .fh-key-result input {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  outline: none;
}
.fh-sim-out {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fh-sim-out > div {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}
.fh-sim-out span { font-size: 10px; color: var(--muted); }
.fh-sim-out strong { font-size: 16px; color: #fff; }

.fh-keygen-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.fh-keygen-row select { flex: 1; }
.fh-btn-primary {
  background: #fff;
  color: #050508;
  border: none;
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.fh-key-result {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}
.fh-key-result input {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #6ee7b7;
}
.fh-key-meta { font-size: 10.5px; color: var(--muted); margin-bottom: 8px; }
.fh-test-row { display: flex; gap: 8px; }

@media (max-width: 600px) {
  .fh-stats-grid, .fh-sim-inputs { grid-template-columns: repeat(2, 1fr); }
  .fh-keygen-row { flex-direction: column; }
}

/* Phase B: Dashboard Sync Everywhere Hub */
.btn-sync {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.38);
  color: #bae6fd;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-sync:hover { background: rgba(56, 189, 248, 0.26); color: #fff; }
.btn-sync.bridge-live {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.55);
  color: #a7f3d0;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.22);
}

.sync-modal-card { width: min(560px, 100%); }
.sync-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.sync-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.38);
  color: #fde68a;
}
.sync-pill.connected {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.48);
  color: #6ee7b7;
}
.sync-auto-lbl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.sync-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 11px;
}
.sync-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}
.sync-box input[type="range"] { width: 100%; accent-color: #38bdf8; }
.sync-site-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.sync-site-btn {
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.sync-site-btn.on {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}
.sync-cta-row { display: flex; gap: 8px; margin-top: 6px; }
.sync-primary-btn {
  flex: 1;
  background: #fff;
  color: #050508;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.sync-secondary-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.sync-footnote { margin-top: 10px; font-size: 10.5px; color: var(--muted); text-align: center; }

@media (max-width: 540px) {
  .sync-site-grid { grid-template-columns: 1fr; }
  .sync-cta-row { flex-direction: column; }
}

/* Module 3: Mobile & Desktop PWA Install Hub */
.btn-install {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e4e4e7;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-install:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.btn-install.install-ready {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.48);
  color: #fde68a;
}

.install-modal-card { width: min(500px, 100%); }
.pwa-install-cta {
  width: 100%;
  background: #fff;
  color: #050508;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
}
.pwa-guide-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.pwa-guide-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #a78bfa;
  margin-bottom: 8px;
}
.pwa-steps {
  padding-left: 18px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.65;
}
.pwa-tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pwa-tip-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pwa-tip-card strong { font-size: 11px; color: #fff; }
.pwa-tip-card span { font-size: 10.5px; color: var(--muted); line-height: 1.4; }

@media (max-width: 520px) {
  .pwa-tips-grid { grid-template-columns: 1fr; }
}
