/* Freelab — front-end styles (brand namespace) */
.freelab {
	--fl-navy: #0e2740;
	--fl-navy-2: #123556;
	--fl-ink: #161e27;
	--fl-muted: #48576a;
	--fl-line: #e3e0d8;
	--fl-soft: #f7f6f3;
	--fl-ok: #226b4c;
	--fl-warn: #9a6414;
	--fl-stop: #a83030;
	--fl-gold: #8a6a1e;
	--fl-r: 12px;
	--fl-r-sm: 9px;
	--fl-ease: cubic-bezier(.22, .61, .36, 1);

	/* spacing scale */
	--fl-space-1: 4px;
	--fl-space-2: 8px;
	--fl-space-3: 12px;
	--fl-space-4: 16px;
	--fl-space-5: 24px;
	--fl-space-6: 32px;
	/* radii */
	--fl-radius-sm: 8px;
	--fl-radius-md: 12px;
	--fl-radius-lg: 16px;
	/* elevation */
	--fl-shadow-1: 0 1px 2px rgba(16, 24, 40, .06);
	--fl-shadow-2: 0 6px 20px rgba(16, 24, 40, .10);
	/* type scale */
	--fl-t-xs: 11px;
	--fl-t-sm: 12.5px;
	--fl-t-md: 14px;
	--fl-t-lg: 18px;
	--fl-t-xl: 23px;
	/* brand accent */
	--fl-accent: #2f6fb0;
	--fl-accent-soft: #eaf2fb;
	max-width: 960px;
	margin: 0 auto;
	color: var(--fl-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.6;
}

.freelab * { box-sizing: border-box; }

.freelab-header h1 { font-size: 1.6rem; margin: 0 0 4px; }
.freelab-sub { color: var(--fl-muted); margin: 0 0 20px; font-size: .9rem; }

.fl-step {
	border: 1px solid var(--fl-line);
	border-radius: var(--fl-r);
	padding: 18px 20px;
	margin-bottom: 18px;
	background: #fff;
}
.fl-step h2 { font-size: 1.1rem; margin: 0 0 12px; }

.fl-demos { margin-bottom: 12px; padding: 10px 12px; border: 1px dashed var(--fl-line); border-radius: var(--fl-r-sm); background: var(--fl-soft); }
.fl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fl-label { display: block; margin-bottom: 10px; font-size: .9rem; color: var(--fl-muted); }
.fl-input {
	display: block;
	width: 100%;
	margin-top: 4px;
	padding: 8px 10px;
	border: 1px solid var(--fl-line);
	border-radius: var(--fl-r-sm);
	font-size: .95rem;
	color: var(--fl-ink);
}
.fl-input:focus-visible { outline: 2px solid var(--fl-navy); outline-offset: 1px; }
.fl-fieldset { border: 1px solid var(--fl-line); border-radius: var(--fl-r-sm); padding: 12px 14px; margin: 0 0 14px; }
.fl-fieldset legend { font-size: .85rem; color: var(--fl-muted); padding: 0 6px; }
.fl-checks label { margin-right: 16px; font-size: .9rem; }

.freelab-btn {
	border: 1px solid var(--fl-line);
	background: var(--fl-soft);
	color: var(--fl-ink);
	border-radius: var(--fl-r-sm);
	padding: 9px 16px;
	min-height: 44px;
	cursor: pointer;
	font-size: .95rem;
}
.freelab-btn.primary { background: var(--fl-navy); border-color: var(--fl-navy); color: #fff; }
.freelab-btn.primary:hover { background: var(--fl-navy-2); }
.freelab-btn:focus-visible { outline: 2px solid var(--fl-navy); outline-offset: 2px; }

.fl-msg { margin-top: 10px; font-size: .9rem; }
.fl-msg.error { color: var(--fl-stop); }
.fl-msg.ok { color: var(--fl-ok); }
.fl-hint { color: var(--fl-muted); font-size: .88rem; }

.fl-bucket { margin-bottom: 16px; }
.fl-bucket h3 { font-size: .95rem; margin: 0 0 8px; }
.fl-bucket.must h3 { color: var(--fl-stop); }
.fl-bucket.improve h3 { color: var(--fl-warn); }
.fl-bucket.unknown h3 { color: var(--fl-muted); }
.fl-bucket.expert h3 { color: var(--fl-navy); }
.fl-bucket.tips h3 { color: var(--fl-muted); }

.fl-issue {
	border: 1px solid var(--fl-line);
	border-left: 3px solid var(--fl-line);
	border-radius: var(--fl-r-sm);
	padding: 10px 12px;
	margin-bottom: 8px;
	background: #fff;
}
.fl-issue.finding { border-left-color: var(--fl-stop); }
.fl-issue.tip { border-left-color: var(--fl-muted); }
.fl-issue.route { border-left-color: var(--fl-navy); }
.fl-issue .fl-code { font-size: .75rem; color: var(--fl-muted); }
.fl-issue .fl-title { font-weight: 600; }
.fl-issue .fl-evidence { font-size: .85rem; color: var(--fl-muted); margin-top: 4px; white-space: pre-wrap; }
.fl-issue .fl-suggestion { font-size: .88rem; margin-top: 6px; }
.fl-issue-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.fl-issue-actions button { font-size: .82rem; padding: 5px 10px; min-height: 32px; border-radius: 6px; border: 1px solid var(--fl-line); background: var(--fl-soft); cursor: pointer; }
.fl-status { font-size: .78rem; color: var(--fl-muted); margin-left: 8px; }

.fl-actions { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.fl-export { background: var(--fl-soft); border: 1px solid var(--fl-line); border-radius: var(--fl-r-sm); padding: 12px; white-space: pre-wrap; max-height: 420px; overflow: auto; }
.fl-diff { font-size: .9rem; }
.fl-diff ul { margin: 6px 0 12px; padding-left: 20px; }

.fl-ctas { margin-top: 16px; display: flex; gap: 12px; flex-wrap: wrap; }
.freelab-cta { color: var(--fl-navy); text-decoration: underline; }

.fl-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.fl-table th, .fl-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--fl-line); }
.fl-table thead th { color: var(--fl-muted); font-weight: 600; }
.freelab-status .fl-entry { margin-bottom: 16px; }

.fl-hero { border: 1px solid var(--fl-line); border-radius: var(--fl-r); padding: 22px 22px; background: #fff; margin-bottom: 18px; }
.fl-hero h2 { margin: 0 0 8px; font-size: 1.35rem; }
.fl-hero-list { color: var(--fl-muted); margin: 10px 0; padding-left: 20px; }
.fl-entry { border: 1px solid var(--fl-line); border-radius: var(--fl-r); padding: 18px 20px; background: #fff; }
.fl-entry h2 { font-size: 1.05rem; margin: 0 0 10px; }

.freelab-footer { color: var(--fl-muted); font-size: .8rem; margin-top: 8px; text-align: center; }

/* Toolbar */
.fl-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.fl-toolbar-demo { font-size: .85rem; color: var(--fl-muted); }
.fl-toolbar-demo .fl-input { display: inline-block; width: auto; margin-left: 6px; }
.fl-help { display: block; margin-top: 4px; font-size: .82rem; color: var(--fl-ok); }
.freelab-btn.ghost { background: transparent; }
.freelab-btn:disabled { opacity: .6; cursor: default; }

/* Stepper */
.fl-stepper ol { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 18px; }
.fl-stepper li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--fl-line); border-radius: 999px; color: var(--fl-muted); font-size: .85rem; cursor: pointer; background: #fff; }
.fl-stepper li:hover { border-color: var(--fl-navy); }
.fl-stepper li:focus-visible { outline: 2px solid var(--fl-navy); outline-offset: 2px; }
.fl-step-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--fl-soft); display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; }
.fl-stepper li.is-done { border-color: var(--fl-ok); color: var(--fl-ok); }
.fl-stepper li.is-done .fl-step-dot { background: var(--fl-ok); color: #fff; }
.fl-stepper li.is-current { border-color: var(--fl-navy); color: var(--fl-navy); font-weight: 600; background: var(--fl-soft); }
.fl-stepper li.is-current .fl-step-dot { background: var(--fl-navy); color: #fff; }

/* Summary */
.fl-summary-box { border: 1px solid var(--fl-line); border-radius: var(--fl-r); background: #fff; padding: 14px 16px; margin-bottom: 14px; }
.fl-summary-count { font-size: 1rem; color: var(--fl-muted); }
.fl-summary-count strong { font-size: 1.5rem; color: var(--fl-ink); }
.fl-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.fl-chip { font-size: .78rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--fl-line); background: var(--fl-soft); }
.fl-chip.must { color: var(--fl-stop); border-color: #e6c4c4; }
.fl-chip.improve { color: var(--fl-warn); border-color: #e8d6b0; }
.fl-chip.unknown { color: var(--fl-muted); }
.fl-chip.expert { color: var(--fl-navy); border-color: #c4d2e6; }
.fl-chip.tips { color: var(--fl-faint, #647587); }
.fl-summary-line { margin: 6px 0; }

/* Skeleton */
.fl-skel { padding: 12px; border: 1px solid var(--fl-line); border-radius: var(--fl-r-sm); margin-bottom: 8px; }
.fl-skel-line { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%); background-size: 400% 100%; animation: fl-shimmer 1.2s infinite; margin: 6px 0; }
.fl-skel-line.w60 { width: 60%; } .fl-skel-line.w90 { width: 90%; }
@keyframes fl-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Toast */
.fl-toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, 90vw); }
.fl-toast { background: var(--fl-ink); color: #fff; padding: 10px 14px; border-radius: var(--fl-r-sm); font-size: .88rem; box-shadow: 0 6px 20px rgba(0,0,0,.18); animation: fl-toast-in .2s ease; }
.fl-toast.ok { background: var(--fl-ok); } .fl-toast.error { background: var(--fl-stop); }
.fl-toast-out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
@keyframes fl-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Empty state */
.fl-empty { text-align: center; padding: 28px 16px; border: 1px dashed var(--fl-line); border-radius: var(--fl-r); color: var(--fl-muted); }
.fl-empty-mark { font-size: 1.6rem; color: var(--fl-ok); }
.fl-empty-title { font-weight: 600; color: var(--fl-ink); margin: 6px 0; }
.fl-empty-hint { font-size: .88rem; }

/* Sticky action */
.fl-stickybar { margin-top: 12px; }

.fl-usage { margin-top: 8px; font-size: .82rem; color: var(--fl-muted); }
/* Header row / workspace bar / filters / keycaps */
.fl-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.fl-ws-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.fl-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.fl-filter { font-size: .8rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--fl-line); background: #fff; cursor: pointer; color: var(--fl-ink); }
.fl-filter.is-active { background: var(--fl-navy); color: #fff; border-color: var(--fl-navy); }
.fl-progress { font-size: .82rem; color: var(--fl-muted); }
kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; border: 1px solid var(--fl-line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--fl-soft); }
.fl-chip.resolved { color: var(--fl-ok); border-color: #bcd8c8; }
.fl-chip.changed { color: var(--fl-warn); border-color: #e8d6b0; }
.fl-chip.added { color: var(--fl-navy); border-color: #c4d2e6; }
.fl-chip.needs_review { color: var(--fl-stop); border-color: #e6c4c4; }

/* Motion */
.freelab-btn, .fl-filter, .fl-input, .fl-issue, .fl-stepper li { transition: background .16s var(--fl-ease), border-color .16s var(--fl-ease), color .16s var(--fl-ease), box-shadow .16s var(--fl-ease), transform .16s var(--fl-ease); }
.fl-issue:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .07); }
.fl-issue:focus-visible { outline: 2px solid var(--fl-navy); outline-offset: 2px; }
.freelab-btn:not(:disabled):hover { transform: translateY(-1px); }

/* Dark theme */
[data-freelab-theme="dark"] .freelab { --fl-ink: #e8eaed; --fl-muted: #a9b1bd; --fl-faint: #8891a0; --fl-line: #2a3340; --fl-soft: #1b212b; color: var(--fl-ink); }
[data-freelab-theme="dark"] .freelab .fl-step,
[data-freelab-theme="dark"] .freelab .fl-summary-box,
[data-freelab-theme="dark"] .freelab .fl-issue,
[data-freelab-theme="dark"] .freelab .fl-hero,
[data-freelab-theme="dark"] .freelab .fl-entry,
[data-freelab-theme="dark"] .freelab .fl-stepper li,
[data-freelab-theme="dark"] .freelab .fl-filter,
[data-freelab-theme="dark"] .freelab .fl-input { background: #12161d; color: var(--fl-ink); }
[data-freelab-theme="dark"] .freelab .fl-input { border-color: var(--fl-line); }
[data-freelab-theme="dark"] .freelab .fl-btn,
[data-freelab-theme="dark"] .freelab .freelab-btn { background: #1b212b; color: var(--fl-ink); border-color: var(--fl-line); }
[data-freelab-theme="dark"] .freelab .freelab-btn.primary { background: #2f6fb0; border-color: #2f6fb0; }
[data-freelab-theme="dark"] .freelab .fl-export { background: #12161d; border-color: var(--fl-line); }
[data-freelab-theme="dark"] .freelab .fl-skel-line { background: linear-gradient(90deg, #1b212b 25%, #232b36 37%, #1b212b 63%); background-size: 400% 100%; }

@media (prefers-reduced-motion: reduce) {
	.fl-skel-line, .fl-toast { animation: none; }
	.freelab-btn, .fl-filter, .fl-input, .fl-issue, .fl-stepper li { transition: none; }
	.freelab-btn:not(:disabled):hover { transform: none; }
}

@media (max-width: 640px) {
	.fl-grid { grid-template-columns: 1fr; }
	.fl-step-label { display: none; }
	.fl-stepper li { padding: 8px 10px; }
	.fl-stickybar { position: sticky; bottom: 0; background: rgba(255,255,255,.96); padding: 10px 0; border-top: 1px solid var(--fl-line); }
	.fl-stickybar .freelab-btn { width: 100%; }
	.fl-toast-region { left: 12px; right: 12px; }
}

/* ============================ Top-tier polish ============================ */

/* Brand wordmark */
.freelab-header h1 { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.2px; }
.freelab-header h1::before { content: ""; width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--fl-accent), var(--fl-navy)); box-shadow: var(--fl-shadow-1); }
.freelab-header { padding-bottom: 14px; border-bottom: 1px solid var(--fl-line); margin-bottom: 18px; }
.freelab-sub { margin-top: 2px; }

/* Cards: consistent elevation + radius */
.fl-step, .fl-hero, .fl-entry, .fl-summary-box, .fl-issue {
	border-radius: var(--fl-radius-md);
	box-shadow: var(--fl-shadow-1);
}
.fl-step:hover, .fl-issue:hover { box-shadow: var(--fl-shadow-2); }

/* Section headings with accent bar */
.fl-step h2, .fl-hero h2, .fl-entry h2 { position: relative; padding-left: 12px; }
.fl-step h2::before, .fl-hero h2::before, .fl-entry h2::before {
	content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; border-radius: 3px;
	background: var(--fl-accent);
}

/* Buttons */
.freelab-btn { border-radius: var(--fl-radius-sm); font-weight: 500; }
.freelab-btn.primary { background: var(--fl-accent); border-color: var(--fl-accent); }
.freelab-btn.primary:hover { background: var(--fl-navy-2); border-color: var(--fl-navy-2); }
.freelab-btn:focus-visible { outline: 2px solid var(--fl-accent); outline-offset: 2px; }
.fl-filter.is-active { background: var(--fl-accent); border-color: var(--fl-accent); }

/* Inputs */
.fl-input { border-radius: var(--fl-radius-sm); transition: border-color .16s var(--fl-ease), box-shadow .16s var(--fl-ease); }
.fl-input:hover { border-color: #cbd3dd; }
.fl-input:focus, .fl-input:focus-visible { border-color: var(--fl-accent); box-shadow: 0 0 0 3px var(--fl-accent-soft); outline: none; }

/* Stepper current accent */
.fl-stepper li.is-current { border-color: var(--fl-accent); color: var(--fl-accent); }
.fl-stepper li.is-current .fl-step-dot { background: var(--fl-accent); }

/* Landing hero */
.fl-hero { background: linear-gradient(180deg, #fff, var(--fl-soft)); }
.fl-hero h2 { font-size: var(--fl-t-xl); }

/* Tables */
.fl-table thead th { background: var(--fl-soft); font-size: var(--fl-t-xs); text-transform: uppercase; letter-spacing: .04em; }
.fl-table tbody tr:nth-child(even) td { background: rgba(0, 0, 0, .015); }
.fl-table { border: 1px solid var(--fl-line); border-radius: var(--fl-radius-md); overflow: hidden; }

/* Anchored sections: comfortable scroll offset */
.fl-step { scroll-margin-top: 16px; }

/* Skip link (a11y) */
.fl-skip { position: absolute; left: -9999px; top: 0; background: var(--fl-navy); color: #fff; padding: 8px 14px; border-radius: 0 0 8px 0; z-index: 10000; }
.fl-skip:focus { left: 0; }

/* Dark refinements */
[data-freelab-theme="dark"] .freelab .fl-table thead th { background: #1b212b; }
[data-freelab-theme="dark"] .freelab .fl-hero { background: linear-gradient(180deg, #12161d, #171d26); }
[data-freelab-theme="dark"] .freelab-header { border-color: var(--fl-line); }

@media (max-width: 640px) {
	.freelab-header h1 { font-size: 1.35rem; }
}

/* ===================== Diagnosis result (rich) ===================== */
.fl-summary-lede { font-size: var(--fl-t-lg); margin: 0 0 8px; }

/* legend */
.fl-legend { font-size: var(--fl-t-sm); color: var(--fl-muted); line-height: 2; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }

/* severity badge (shared) */
.fl-sev { display: inline-block; font-size: var(--fl-t-xs); font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--fl-line); background: var(--fl-soft); color: var(--fl-muted); white-space: nowrap; }
.fl-sev.must { color: #fff; background: var(--fl-stop); border-color: var(--fl-stop); }
.fl-sev.improve { color: #fff; background: var(--fl-warn); border-color: var(--fl-warn); }
.fl-sev.unknown { color: var(--fl-muted); background: #eef1f5; border-color: #d7dee7; }
.fl-sev.expert { color: #fff; background: var(--fl-accent); border-color: var(--fl-accent); }
.fl-sev.tips { color: var(--fl-faint); background: var(--fl-soft); }

/* dimension overview */
.fl-dims { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.fl-dim { border: 1px solid var(--fl-line); border-radius: var(--fl-radius-md); padding: 12px 14px; background: #fff; box-shadow: var(--fl-shadow-1); }
.fl-dim-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.fl-dim-letter { width: 22px; height: 22px; border-radius: 6px; background: var(--fl-accent-soft); color: var(--fl-accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--fl-t-sm); }
.fl-dim-name { font-size: var(--fl-t-sm); color: var(--fl-ink); flex: 1; }
.fl-dim-count { font-size: var(--fl-t-md); font-weight: 700; color: var(--fl-ink); }
.fl-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: #eef1f5; margin-bottom: 8px; }
.fl-bar-seg { display: block; height: 100%; }
.fl-bar-seg.must { background: var(--fl-stop); }
.fl-bar-seg.improve { background: var(--fl-warn); }
.fl-bar-seg.unknown { background: #9aa7b5; }
.fl-bar-seg.expert { background: var(--fl-accent); }
.fl-bar-seg.tips { background: #c7cdd6; }
.fl-bar-seg.ok { background: var(--fl-ok); width: 100%; }
.fl-dim-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fl-dim-ok { font-size: var(--fl-t-sm); color: var(--fl-ok); }

/* bucket header */
.fl-bucket h3 { display: flex; align-items: center; gap: 8px; }
.fl-bucket-count { font-size: var(--fl-t-sm); color: var(--fl-muted); font-weight: 400; }

/* rich finding card */
.fl-fcard { position: relative; border: 1px solid var(--fl-line); border-radius: var(--fl-radius-md); background: #fff; padding: 14px 16px 12px 18px; margin: 0 0 10px; box-shadow: var(--fl-shadow-1); }
.fl-fcard::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--fl-line); }
.fl-fcard.must::before { background: var(--fl-stop); }
.fl-fcard.improve::before { background: var(--fl-warn); }
.fl-fcard.unknown::before { background: #9aa7b5; }
.fl-fcard.expert::before { background: var(--fl-accent); }
.fl-fcard.tips::before { background: #c7cdd6; }
.fl-fcard-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fl-fcard-title { font-weight: 600; color: var(--fl-ink); }
.fl-fcard-code { margin-left: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fl-t-xs); color: var(--fl-faint); }
.fl-dim-badge { width: 20px; height: 20px; border-radius: 6px; background: var(--fl-accent-soft); color: var(--fl-accent); font-size: var(--fl-t-xs); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.fl-fcard-desc { margin: 4px 0; color: var(--fl-ink); }
.fl-quote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--fl-line); background: var(--fl-soft); border-radius: 0 var(--fl-radius-sm) var(--fl-radius-sm) 0; color: var(--fl-muted); font-size: var(--fl-t-sm); white-space: pre-wrap; }
.fl-row { display: grid; grid-template-columns: 84px 1fr; gap: 10px; margin: 6px 0; }
.fl-row-label { font-size: var(--fl-t-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--fl-faint); padding-top: 2px; }
.fl-row-text { color: var(--fl-ink); }
.fl-fcard-actions { margin-top: 8px; }
.fl-linkbtn { border: 0; background: none; color: var(--fl-accent); cursor: pointer; font-size: var(--fl-t-sm); padding: 4px 0; text-decoration: underline; text-underline-offset: 2px; }
.fl-linkbtn:focus-visible { outline: 2px solid var(--fl-accent); outline-offset: 2px; border-radius: 4px; }

/* dark adjustments */
[data-freelab-theme="dark"] .freelab .fl-dim,
[data-freelab-theme="dark"] .freelab .fl-fcard { background: #12161d; }
[data-freelab-theme="dark"] .freelab .fl-bar,
[data-freelab-theme="dark"] .freelab .fl-sev.unknown { background: #232b36; }
[data-freelab-theme="dark"] .freelab .fl-quote { background: #1b212b; }

/* ===================== Wizard flow + unified chrome ===================== */
.fl-stepper { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.2) blur(6px); padding: 8px 0; margin-bottom: 16px; }
[data-freelab-theme="dark"] .freelab .fl-stepper { background: rgba(18,22,29,.92); }
.fl-stepper ol { margin: 0; }

.fl-step:not([hidden]) { animation: fl-step-in .22s var(--fl-ease); }
@keyframes fl-step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fl-step:not([hidden]) { animation: none; } }

.fl-stepfoot { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--fl-line); flex-wrap: wrap; }

/* Collapsible buckets */
.fl-bucket-h { cursor: pointer; user-select: none; }
.fl-caret { margin-left: auto; color: var(--fl-faint); transition: transform .16s var(--fl-ease); }
.fl-bucket.is-collapsed .fl-caret { transform: rotate(-90deg); }
.fl-bucket.is-collapsed .fl-bucket-body { display: none; }
.fl-bucket-h:focus-visible { outline: 2px solid var(--fl-accent); outline-offset: 3px; border-radius: 6px; }

/* Unified table look (front-end + admin) */
.freelab .fl-table, .freelab-admin .fl-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fl-t-sm); }
.freelab .fl-table th, .freelab .fl-table td, .freelab-admin .fl-table th, .freelab-admin .fl-table td { padding: 9px 12px; border-bottom: 1px solid var(--fl-line); text-align: left; }
.freelab-admin .fl-table th { background: #f6f7f7; }

/* Admin coordination */
.freelab-admin { max-width: 1100px; color: var(--fl-ink); }
.freelab-admin h1 { font-weight: 700; }
.freelab-admin .button-primary { background: var(--fl-accent); border-color: var(--fl-accent); }
.freelab-admin code { background: var(--fl-soft); padding: 1px 5px; border-radius: 5px; }

/* ===================== Two-column shell (S-tier) ===================== */
.fl-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 30px; max-width: 1140px; margin: 0 auto; align-items: start; }
.fl-main { min-width: 0; max-width: 780px; }

.fl-rail { position: sticky; top: 18px; align-self: start; display: flex; flex-direction: column; gap: 16px; }
.fl-rail-brand h1 { display: flex; align-items: center; gap: 9px; font-size: 1.25rem; font-weight: 700; letter-spacing: -.2px; margin: 0; }
.fl-rail-brand h1::before { content: ""; width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, var(--fl-accent), var(--fl-navy)); }
.fl-rail-sub { margin: 2px 0 0; font-size: var(--fl-t-sm); color: var(--fl-muted); }

/* vertical stepper inside the rail */
.fl-rail .fl-stepper { position: static; background: none; backdrop-filter: none; padding: 0; margin: 0; }
.fl-rail .fl-stepper ol { flex-direction: column; gap: 4px; }
.fl-rail .fl-stepper li { width: 100%; justify-content: flex-start; border: 1px solid transparent; background: transparent; padding: 8px 10px; }
.fl-rail .fl-stepper li:hover { background: var(--fl-soft); border-color: var(--fl-line); }
.fl-rail .fl-stepper li.is-current { background: var(--fl-accent-soft); border-color: transparent; }
.fl-rail .fl-stepper li.is-done { background: transparent; }
.fl-rail .fl-step-dot { width: 22px; height: 22px; }

/* rail summary */
.fl-rail-summary:not(:empty) { border: 1px solid var(--fl-line); border-radius: var(--fl-radius-md); padding: 10px 12px; background: var(--fl-soft); }
.fl-rail-title { font-size: var(--fl-t-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--fl-faint); margin-bottom: 6px; }
.fl-railstat { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 5px 0; }
.fl-railstat b { font-size: var(--fl-t-md); }

.fl-rail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fl-railbtn { border: 1px solid var(--fl-line); background: #fff; color: var(--fl-ink); border-radius: var(--fl-radius-sm); padding: 7px 11px; cursor: pointer; font-size: var(--fl-t-sm); }
.fl-railbtn:hover { border-color: var(--fl-accent); color: var(--fl-accent); }
.fl-railbtn:focus-visible { outline: 2px solid var(--fl-accent); outline-offset: 2px; }
.fl-rail-foot { font-size: var(--fl-t-xs); color: var(--fl-faint); }

[data-freelab-theme="dark"] .freelab .fl-rail-summary:not(:empty) { background: #1b212b; }
[data-freelab-theme="dark"] .freelab .fl-railbtn { background: #1b212b; }
[data-freelab-theme="dark"] .freelab .fl-rail .fl-stepper li.is-current { background: #17233a; }

@media (max-width: 1024px) {
	.fl-shell { grid-template-columns: 1fr; gap: 18px; }
	.fl-main { max-width: none; }
	.fl-rail { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; border-bottom: 1px solid var(--fl-line); padding-bottom: 12px; }
	.fl-rail .fl-stepper { flex: 1 1 240px; }
	.fl-rail .fl-stepper ol { flex-direction: row; flex-wrap: wrap; }
	.fl-rail .fl-stepper li { width: auto; }
	.fl-rail-summary, .fl-rail-foot { display: none; }
	.fl-rail-actions { margin-left: auto; }
}

/* ===================== App shell: topbar + editor|review ===================== */
.fl-app { max-width: 1280px; margin: 0 auto; }
.fl-topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 0; margin-bottom: 18px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.2) blur(6px); border-bottom: 1px solid var(--fl-line); flex-wrap: wrap; }
[data-freelab-theme="dark"] .freelab .fl-topbar { background: rgba(18,22,29,.92); }
.fl-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.fl-brand-mark { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, var(--fl-accent), var(--fl-navy)); display: inline-block; }
.fl-brand-name { font-size: 1.1rem; letter-spacing: -.2px; }
.fl-brand-sub { font-weight: 400; color: var(--fl-muted); font-size: var(--fl-t-sm); }
.fl-topbar .fl-stepper { position: static; background: none; backdrop-filter: none; padding: 0; margin: 0; }
.fl-topbar .fl-stepper ol { flex-direction: row; }
.fl-topbar .fl-stepper li { padding: 6px 10px; }
.fl-topactions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.fl-usage { font-size: var(--fl-t-xs); color: var(--fl-muted); }
.fl-iconbtn { border: 1px solid var(--fl-line); background: #fff; color: var(--fl-ink); border-radius: 8px; width: 34px; height: 32px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.fl-iconbtn:hover { border-color: var(--fl-accent); color: var(--fl-accent); }
.fl-iconbtn:focus-visible { outline: 2px solid var(--fl-accent); outline-offset: 2px; }

.fl-cols { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 26px; align-items: start; }
.fl-editor, .fl-review { min-width: 0; }
.fl-editor { position: sticky; top: 68px; max-height: calc(100vh - 88px); overflow: auto; padding-right: 6px; }
.fl-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.fl-pane-head h2 { margin: 0; font-size: var(--fl-t-lg); }
.fl-pane-label { font-size: var(--fl-t-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--fl-faint); }
.fl-panel > h2 { font-size: var(--fl-t-lg); margin: 0 0 10px; }

/* Details/module collapse in editor */
.fl-editor details.fl-fieldset { border: 1px solid var(--fl-line); border-radius: var(--fl-radius-md); padding: 10px 14px; margin-bottom: 12px; background: #fff; }
.fl-editor details.fl-fieldset > summary { cursor: pointer; font-size: var(--fl-t-sm); color: var(--fl-muted); font-weight: 600; list-style: none; display: flex; align-items: center; gap: 6px; }
.fl-editor details.fl-fieldset > summary::-webkit-details-marker { display: none; }
.fl-editor details.fl-fieldset > summary::before { content: "▸"; transition: transform .16s var(--fl-ease); }
.fl-editor details.fl-fieldset[open] > summary::before { transform: rotate(90deg); }
.fl-editor details.fl-fieldset > summary ~ * { margin-top: 10px; }

/* Focus (放大) modes */
.fl-cols.focus-edit { grid-template-columns: 1fr; }
.fl-cols.focus-edit .fl-review { display: none; }
.fl-cols.focus-edit .fl-editor { position: static; max-height: none; }
.fl-cols.focus-review { grid-template-columns: 1fr; }
.fl-cols.focus-review .fl-editor { display: none; }

/* Compact density (缩小) */
.fl-app.fl-compact .fl-step, .fl-app.fl-compact .fl-editor details.fl-fieldset { padding: 10px 12px; margin-bottom: 8px; }
.fl-app.fl-compact .fl-fcard { padding: 10px 12px 8px 16px; margin-bottom: 6px; }
.fl-app.fl-compact .fl-input { padding: 6px 9px; }
.fl-app.fl-compact .fl-label { margin-bottom: 6px; }

@media (max-width: 1024px) {
	.fl-cols { grid-template-columns: 1fr; gap: 18px; }
	.fl-editor { position: static; max-height: none; overflow: visible; }
	.fl-focus-edit, .fl-focus-review { display: none; }
	.fl-topbar .fl-brand-sub { display: none; }
	.fl-usage { display: none; }
}
[data-freelab-theme="dark"] .freelab .fl-iconbtn { background: #1b212b; }
[data-freelab-theme="dark"] .freelab .fl-editor details.fl-fieldset { background: #12161d; }

/* ===================== Wide layout + resizable columns ===================== */
.fl-app { max-width: min(1600px, 100%); }

.fl-cols { grid-template-columns: var(--fl-editor-w, 420px) 7px minmax(0, 1fr); gap: 0; }
.fl-editor { position: static; top: auto; max-height: none; overflow: visible; padding-right: 18px; }
.fl-review { padding-left: 18px; }

/* drag divider */
.fl-resizer { cursor: col-resize; align-self: stretch; position: relative; min-height: 260px; }
.fl-resizer::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--fl-line); transform: translateX(-50%); transition: background .16s var(--fl-ease), width .16s var(--fl-ease); }
.fl-resizer:hover::before, .fl-resizer:focus-visible::before, .fl-resizer.is-drag::before { background: var(--fl-accent); width: 2px; }
.fl-resizer:focus-visible { outline: none; }
.fl-resizer::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 34px; transform: translate(-50%, -50%); border-radius: 3px; background: var(--fl-line); opacity: 0; transition: opacity .16s var(--fl-ease); }
.fl-resizer:hover::after, .fl-resizer:focus-visible::after, .fl-resizer.is-drag::after { opacity: 1; background: var(--fl-accent); }

body.fl-resizing { cursor: col-resize; user-select: none; }

.fl-cols.focus-edit, .fl-cols.focus-review { grid-template-columns: 1fr; }
.fl-cols.focus-edit .fl-editor, .fl-cols.focus-review .fl-review { padding: 0; }
.fl-cols.focus-edit .fl-resizer, .fl-cols.focus-review .fl-resizer { display: none; }

@media (max-width: 1024px) {
	.fl-cols { grid-template-columns: 1fr; }
	.fl-editor { padding-right: 0; }
	.fl-review { padding-left: 0; }
	.fl-resizer { display: none; }
}

/* ============ Width normalization + full-bleed + typography lock ============ */
/* Full-bleed the app out of a theme's constrained content column. */
.fl-app {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding: 0 clamp(16px, 3vw, 56px);
}

/* Fixed, coordinated base typography (ignore theme body size). */
.freelab { font-size: 15px; line-height: 1.6; }
.freelab p, .freelab li, .freelab label, .freelab td, .freelab th { font-size: inherit; }
.fl-app .fl-fcard-title,
.fl-app .fl-fcard-desc,
.fl-app .fl-row-text,
.fl-app .fl-summary-line,
.fl-app .fl-summary-lede { font-size: 15px; }
.fl-app .fl-summary-lede { font-size: 17px; font-weight: 600; }
.fl-app .fl-hint, .fl-app .fl-quote { font-size: 13px; }
.fl-app .fl-bucket h3 { font-size: 15px; }
.fl-app .fl-fcard-code { font-size: 12px; }
.fl-app .fl-dim-name { font-size: 13px; }
.fl-app .fl-panel > h2, .fl-app .fl-step h2, .fl-app .fl-pane-head h2 { font-size: 18px; }
.freelab .fl-empty-title { font-size: 15px; }
.freelab .fl-empty-hint { font-size: 13px; }

@media (max-width: 1024px) {
	.fl-app { padding: 0 16px; }
}

/* ============ Comfortable, space-efficient layout (M24) ============ */
/* Escape the theme column (full-bleed) but keep a comfortable, centered measure. */
.fl-app {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding: 0 clamp(16px, 3vw, 56px);
}
.fl-cols,
.fl-topbar { max-width: 1500px; margin-left: auto; margin-right: auto; }
.fl-topbar { padding-top: 8px; padding-bottom: 8px; margin-bottom: 14px; }

/* Balanced columns + a friendlier default split. */
.fl-cols { grid-template-columns: var(--fl-editor-w, clamp(320px, 32%, 540px)) 8px minmax(0, 1fr); gap: 0; }
.fl-editor { padding-right: 14px; }
.fl-review { padding-left: 14px; }

/* Tighter, comfortable vertical rhythm. */
.fl-app .fl-step, .fl-app .fl-panel { margin-bottom: 0; }
.fl-review .fl-bucket { margin-bottom: 16px; }
.fl-review .fl-dim { padding: 11px 13px; }

/* Slightly denser top bar. */
.fl-topbar .fl-stepper li { padding: 5px 10px; }
.fl-topbar .fl-brand-sub { opacity: .8; }

@media (max-width: 1024px) {
	.fl-app { padding: 0 16px; }
	.fl-cols, .fl-topbar { max-width: none; }
}

/* ===================== Full-screen app (drop inner cap) ===================== */
.fl-cols, .fl-topbar { max-width: none; }

/* ===================== Homepage (top-tier landing) ===================== */
.freelab-home { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); padding: 0; font-size: 15px; line-height: 1.6; }

.lp-hero { background: linear-gradient(160deg, #0e2740, #123556 55%, #0e2740); color: #fff; padding: clamp(48px, 8vw, 120px) clamp(20px, 6vw, 80px); }
.lp-hero-inner { max-width: 1060px; margin: 0 auto; }
.lp-badge { display: inline-block; font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: #cfe0f4; border: 1px solid rgba(255,255,255,.28); padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }
.lp-hero h1 { font-size: clamp(29px, 4.6vw, 56px); line-height: 1.12; margin: 0 0 14px; font-weight: 700; letter-spacing: -.6px; }
.lp-lede { font-size: clamp(15px, 1.5vw, 19px); opacity: .92; max-width: 700px; margin: 0 0 8px; }
.lp-cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.lp-cta-row.center { justify-content: center; }
.lp-btn { display: inline-flex; align-items: center; gap: 6px; padding: 12px 20px; border-radius: 10px; font-size: 15px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.lp-btn.primary { background: #fff; color: #0e2740; }
.lp-btn.primary:hover { background: #eef3fa; }
.lp-btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.lp-btn.ghost:hover { border-color: #fff; }
.lp-note { margin-top: 16px; font-size: 13px; opacity: .72; }

.lp-section { padding: clamp(44px, 6vw, 88px) clamp(20px, 6vw, 80px); }
.lp-section-inner { max-width: 1120px; margin: 0 auto; }
.lp-h2 { font-size: clamp(22px, 2.6vw, 32px); margin: 0 0 8px; letter-spacing: -.3px; }
.lp-sub { color: var(--fl-muted); max-width: 740px; margin: 0 0 4px; }
.lp-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-top: 20px; }
.lp-card { border: 1px solid var(--fl-line); border-radius: 14px; padding: 22px; background: #fff; box-shadow: var(--fl-shadow-1); }
.lp-card h3 { margin: 12px 0 6px; font-size: 17px; }
.lp-card p { margin: 0; color: var(--fl-muted); }
.lp-num { display: inline-flex; width: 30px; height: 30px; border-radius: 9px; background: var(--fl-accent-soft); color: var(--fl-accent); align-items: center; justify-content: center; font-weight: 700; }

.lp-band { background: var(--fl-soft); }
.lp-steps { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: lp; }
.lp-steps li { background: #fff; border: 1px solid var(--fl-line); border-radius: 14px; padding: 20px; box-shadow: var(--fl-shadow-1); }
.lp-steps h3 { margin: 12px 0 6px; font-size: 16px; }
.lp-steps p { margin: 0; color: var(--fl-muted); font-size: 14px; }
.lp-step-n { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--fl-accent); color: #fff; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

.lp-trust { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center; }
.lp-checks { list-style: none; margin: 0; padding: 0; }
.lp-checks li { padding: 11px 0 11px 26px; position: relative; border-bottom: 1px solid var(--fl-line); color: var(--fl-ink); }
.lp-checks li::before { content: "✓"; position: absolute; left: 0; color: var(--fl-ok); font-weight: 700; }

.lp-cta-band { background: linear-gradient(160deg, #0e2740, #123556); color: #fff; text-align: center; }
.lp-cta-band .lp-h2 { color: #fff; }
.lp-cta-band .lp-btn.ghost { color: #fff; }

.lp-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding: 22px clamp(20px, 6vw, 80px); border-top: 1px solid var(--fl-line); color: var(--fl-muted); font-size: 13px; }
.lp-foot-links { display: flex; gap: 16px; }

@media (max-width: 820px) {
	.lp-trust { grid-template-columns: 1fr; }
}

/* ===================== Full-screen canvas (no theme chrome) ===================== */
body.freelab-canvas { margin: 0; background: #fff; }
body.freelab-canvas #page, body.freelab-canvas .wp-site-blocks { all: unset; }
body.admin-bar .fl-topbar { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar .fl-topbar { top: 46px; } }
body.freelab-canvas .fl-app { min-height: calc(100vh - 32px); }

/* ===================== Fix overflow + site nav (M27) ===================== */
/* Full width without the 100vw breakout (which caused horizontal overflow). */
.fl-app, .freelab-home { width: auto; max-width: none; margin-left: 0; margin-right: 0; box-sizing: border-box; }
body.freelab-canvas { overflow-x: hidden; }

/* Compact site navigation */
.fl-nav ul { list-style: none; display: flex; gap: 14px; margin: 0; padding: 0; flex-wrap: wrap; }
.fl-nav a { text-decoration: none; color: inherit; font-size: 14px; opacity: .88; }
.fl-nav a:hover { opacity: 1; text-decoration: underline; }
.fl-nav-top { flex: 0 1 auto; }
@media (max-width: 1180px) { .fl-nav-top { display: none; } }

/* Landing top bar */
.lp-topbar { position: sticky; top: 0; z-index: 40; background: #0e2740; color: #fff; }
.lp-topbar-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 12px clamp(16px, 4vw, 40px); }
.lp-logo { color: #fff; text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.lp-logo .fl-brand-mark { width: 18px; height: 18px; border-radius: 5px; }
.lp-nav { margin-left: auto; }
.lp-nav a { color: #dbe6f3; }
.lp-btn.small { padding: 8px 14px; font-size: 14px; }
@media (max-width: 820px) { .lp-nav { display: none; } }
body.admin-bar .lp-topbar { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar .lp-topbar { top: 46px; } }

/* ===================== Brand mark + About page (M28) ===================== */
.fl-brand-org { font-size: 12px; color: var(--fl-muted); text-decoration: none; border: 1px solid var(--fl-line); border-radius: 999px; padding: 2px 9px; margin-left: 4px; white-space: nowrap; }
.fl-brand-org:hover { color: var(--fl-accent); border-color: var(--fl-accent); }
.lp-org { color: #cfe0f4; text-decoration: none; font-size: 13px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 3px 11px; margin-left: 6px; }
.lp-org:hover { border-color: #fff; }

.ab-inline-link { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.ab-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.ab-list { list-style: none; margin: 0; padding: 0; }
.ab-list li { padding: 7px 0 7px 24px; position: relative; color: var(--fl-muted); }
.ab-list.yes li::before { content: "✓"; position: absolute; left: 0; color: var(--fl-ok); font-weight: 700; }
.ab-list.no li::before { content: "✕"; position: absolute; left: 0; color: var(--fl-stop); font-weight: 700; }
.ab-grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (max-width: 820px) { .ab-two { grid-template-columns: 1fr; } .fl-brand-org { display: none; } }

/* ===================== M29 · premium palette + button + swap + dark ===================== */
.freelab { --fl-accent: #2563eb; --fl-accent-2: #1d4ed8; --fl-accent-soft: #e8f0fe; }
body.freelab-canvas { background: #f6f7f9; }

/* Prominent primary action */
.freelab-btn.primary {
	background: linear-gradient(180deg, #3b82f6, #2563eb);
	border-color: #2563eb;
	color: #fff;
	box-shadow: 0 1px 2px rgba(37, 99, 235, .3);
}
.freelab-btn.primary:hover { background: linear-gradient(180deg, #2563eb, #1d4ed8); border-color: #1d4ed8; box-shadow: 0 8px 20px rgba(37, 99, 235, .32); transform: translateY(-1px); }
.freelab-btn.primary:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(37, 99, 235, .3); }

/* Make 开始诊断 unmissable */
.fl-stickybar { position: sticky; bottom: 12px; background: linear-gradient(180deg, rgba(246,247,249,0), #f6f7f9 40%); padding-top: 14px; }
.fl-stickybar .freelab-btn.primary { width: 100%; padding: 15px 20px; font-size: 16px; font-weight: 700; letter-spacing: .2px; border-radius: 12px; }
.fl-stickybar .freelab-btn.primary::after { content: " →"; }

/* Swap panes */
.fl-cols.swapped { grid-template-columns: minmax(0, 1fr) 8px var(--fl-editor-w, clamp(320px, 32%, 540px)); }
.fl-cols.swapped > .fl-editor { grid-column: 3; padding-right: 0; padding-left: 14px; }
.fl-cols.swapped > .fl-review { grid-column: 1; padding-left: 0; padding-right: 14px; }
.fl-cols.swapped > .fl-resizer { grid-column: 2; }
.fl-iconbtn[aria-pressed="true"] { border-color: var(--fl-accent); color: var(--fl-accent); background: var(--fl-accent-soft); }

/* Coherent dark theme (token-driven) */
[data-freelab-theme="dark"] .freelab {
	--fl-ink: #e6e9ee; --fl-muted: #9aa4b2; --fl-faint: #7d8794;
	--fl-line: #2a3340; --fl-soft: #1b2230; --fl-bg: #0d1117; --fl-surface: #161b22;
	--fl-accent: #5b8def; --fl-accent-2: #4f7fe0; --fl-accent-soft: #1e2a44;
	--fl-ok: #3ecf8e; --fl-warn: #e0a458; --fl-stop: #e06c6c;
	color: var(--fl-ink);
}
html[data-freelab-theme="dark"] body.freelab-canvas { background: #0d1117; }
[data-freelab-theme="dark"] .freelab .fl-stickybar { background: linear-gradient(180deg, rgba(13,17,23,0), #0d1117 40%); }
[data-freelab-theme="dark"] .freelab .fl-step,
[data-freelab-theme="dark"] .freelab .fl-summary-box,
[data-freelab-theme="dark"] .freelab .fl-fcard,
[data-freelab-theme="dark"] .freelab .fl-dim,
[data-freelab-theme="dark"] .freelab .fl-editor details.fl-fieldset,
[data-freelab-theme="dark"] .freelab .fl-stepper li,
[data-freelab-theme="dark"] .freelab .fl-filter,
[data-freelab-theme="dark"] .freelab .fl-iconbtn,
[data-freelab-theme="dark"] .freelab .fl-railbtn,
[data-freelab-theme="dark"] .freelab .fl-export,
[data-freelab-theme="dark"] .freelab .fl-empty { background: #161b22; border-color: #2a3340; color: var(--fl-ink); }
[data-freelab-theme="dark"] .freelab .fl-input { background: #0d1117; border-color: #2a3340; color: var(--fl-ink); }
[data-freelab-theme="dark"] .freelab .fl-topbar { background: rgba(13,17,23,.92); border-bottom-color: #2a3340; }
[data-freelab-theme="dark"] .freelab .fl-quote { background: #0d1117; border-color: #2a3340; }
[data-freelab-theme="dark"] .freelab .fl-bar { background: #232b36; }
[data-freelab-theme="dark"] .freelab .fl-skel-line { background: linear-gradient(90deg, #1b2230 25%, #232b36 37%, #1b2230 63%); background-size: 400% 100%; }
[data-freelab-theme="dark"] .freelab .fl-chip { background: #1b2230; border-color: #2a3340; }
[data-freelab-theme="dark"] .freelab .fl-issue { background: #161b22; border-color: #2a3340; }

/* ===================== M30 · robust swaps via flex ===================== */
.fl-cols { display: flex; align-items: flex-start; gap: 0; grid-template-columns: none; }
.fl-editor { flex: 0 0 var(--fl-editor-w, clamp(320px, 32%, 540px)); min-width: 0; padding-right: 0; }
.fl-resizer { flex: 0 0 16px; }
.fl-review { flex: 1 1 auto; min-width: 0; padding-left: 0; }
.fl-cols.swapped { flex-direction: row-reverse; }
.fl-cols.focus-edit, .fl-cols.focus-review { flex-direction: column; }
.fl-cols.focus-edit .fl-editor, .fl-cols.focus-review .fl-review { flex: 1 1 auto; }
@media (max-width: 1024px) { .fl-cols, .fl-cols.swapped { flex-direction: column; } }

/* ===================== M31 · sticky bar must not cover headings ===================== */
.fl-step, .fl-panel, .fl-editor, .fl-review, .fl-pane-head,
#fl-input-h, #fl-diag-h, #fl-ws-h, #fl-rc-h { scroll-margin-top: 96px; }

/* Opaque top bar matching the canvas so nothing bleeds through */
.fl-topbar { background: rgba(246, 247, 249, .97); box-shadow: 0 1px 0 var(--fl-line); }
[data-freelab-theme="dark"] .freelab .fl-topbar { background: rgba(13, 17, 23, .97); }

/* On wide screens keep the two columns aligned to the bar baseline */
.fl-cols { padding-top: 2px; }

/* ===================== M32 · top bar static (never covers content) ===================== */
.fl-topbar { position: static; top: auto; }
body.admin-bar .fl-topbar { top: auto; }
.lp-topbar { position: static; top: auto; }
body.admin-bar .lp-topbar { top: auto; }
.fl-cols { padding-top: 0; }
/* keep the pane head clear of the bar even if a browser restores scroll */
.fl-pane-head, .fl-editor > h2, .fl-review > .fl-pane-head { scroll-margin-top: 24px; }

/* ===================== M33 · admin-bar offset on the canvas ===================== */
/* Neutralize WP's html margin inside the canvas; offset the body instead. */
html.freelab-canvas-html { margin-top: 0 !important; }
body.freelab-canvas { padding-top: 0; }
body.admin-bar.freelab-canvas { padding-top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar.freelab-canvas { padding-top: 46px; }
}

/* ===================== M34 · workspace master-detail ===================== */
.fl-ws-cols { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.fl-ws-list { display: flex; flex-direction: column; gap: 6px; }
.fl-ws-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; text-align: left; width: 100%; background: #fff; border: 1px solid var(--fl-line); border-radius: var(--fl-radius-sm); padding: 10px 12px; cursor: pointer; color: var(--fl-ink); font: inherit; }
.fl-ws-row:hover { border-color: var(--fl-accent); }
.fl-ws-row:focus-visible { outline: 2px solid var(--fl-accent); outline-offset: 1px; }
.fl-ws-row.is-selected { border-color: var(--fl-accent); background: var(--fl-accent-soft); box-shadow: var(--fl-shadow-1); }
.fl-ws-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fl-line); }
.fl-ws-row.must .fl-ws-dot { background: var(--fl-stop); }
.fl-ws-row.improve .fl-ws-dot { background: var(--fl-warn); }
.fl-ws-row.unknown .fl-ws-dot { background: #9aa7b5; }
.fl-ws-row.expert .fl-ws-dot { background: var(--fl-accent); }
.fl-ws-row.tips .fl-ws-dot { background: #c7cdd6; }
.fl-ws-row-main { min-width: 0; }
.fl-ws-row-title { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-ws-row-meta { font-size: 12px; color: var(--fl-faint); }
.fl-ws-row-status { font-size: 11px; color: var(--fl-muted); text-transform: uppercase; letter-spacing: .04em; }
.fl-ws-detail { min-width: 0; }
.fl-ws-detail .fl-fcard { margin: 0; }

[data-freelab-theme="dark"] .freelab .fl-ws-row { background: #161b22; border-color: #2a3340; }
[data-freelab-theme="dark"] .freelab .fl-ws-row.is-selected { background: #1e2a44; border-color: var(--fl-accent); }

@media (max-width: 1180px) {
	.fl-ws-cols { grid-template-columns: 1fr; }
	.fl-ws-list { flex-direction: row; flex-wrap: wrap; }
	.fl-ws-row { width: auto; }
}

/* ===================== M35 · workspace discoverability ===================== */
.fl-ws-col { min-width: 0; }
.fl-ws-collabel { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--fl-faint); margin-bottom: 8px; }
.fl-buckets .fl-fcard[data-code] { cursor: pointer; }
.fl-buckets .fl-fcard[data-code]:hover { box-shadow: var(--fl-shadow-2); }

/* ===================== P0.2 · pending (待补充) bucket ===================== */
.fl-bucket.pending .fl-sev.pending { background: var(--fl-line, #e5e7eb); color: var(--fl-muted, #4b5563); }
.fl-pending-list { margin: 8px 0 0; padding-left: 20px; }
.fl-pending-item { list-style: disc; color: var(--fl-fg, #111); }

/* ===================== P0.2 · public sample report ===================== */
.fl-sample { max-width: 920px; margin: 0 auto; padding: 24px 20px 64px; }
.fl-sample-head h1 { margin: 0 0 6px; }
.fl-sample section { margin: 22px 0; }
.fl-sample section > h2 { font-size: 18px; margin: 0 0 10px; }
.fl-sample-guide ol { margin: 0; padding-left: 20px; }
.fl-sample-cta .freelab-btn { margin-right: 8px; }

/* ===================== Controlled registration ===================== */
.fl-register { max-width: 520px; margin: 0 auto; padding: 28px 20px 64px; }
.fl-register-form { display: grid; gap: 14px; margin-top: 16px; }
.fl-register .freelab-btn { margin-right: 8px; }

/* ===================== Landscape/About: dark-theme surfaces (contrast fix) ===================== */
/* In dark mode the landing/about cards were hardcoded white while text used
   light tokens -> text vanished. Make surfaces token-driven. */
[data-freelab-theme="dark"] .freelab .lp-card,
[data-freelab-theme="dark"] .freelab .lp-steps li {
	background: #161b22;
	border-color: #2a3340;
	color: var(--fl-ink);
}
[data-freelab-theme="dark"] .freelab .lp-card h3,
[data-freelab-theme="dark"] .freelab .lp-steps h3,
[data-freelab-theme="dark"] .freelab .lp-h2 { color: var(--fl-ink); }
[data-freelab-theme="dark"] .freelab .lp-card p,
[data-freelab-theme="dark"] .freelab .lp-steps p,
[data-freelab-theme="dark"] .freelab .lp-sub,
[data-freelab-theme="dark"] .freelab .ab-list li { color: var(--fl-muted); }
[data-freelab-theme="dark"] .freelab .lp-band { background: var(--fl-soft); }
[data-freelab-theme="dark"] .freelab .lp-num { background: var(--fl-accent-soft); color: #cfe0f4; }
[data-freelab-theme="dark"] .freelab .lp-checks li { border-bottom-color: var(--fl-line); }
[data-freelab-theme="dark"] .freelab .lp-foot { border-top-color: var(--fl-line); }

/* Ensure readable text selection in both themes. */
.freelab ::selection { background: #bfdbfe; color: #0b1220; }
[data-freelab-theme="dark"] .freelab ::selection { background: #1e3a8a; color: #ffffff; }

/* Account notice (login/register) */
.fl-login-note { margin: 8px 0 14px; padding: 12px 14px; border: 1px solid #dbe4f0; border-left: 4px solid var(--fl-accent, #2563eb); background: #f5f9ff; border-radius: 10px; font-size: 13px; line-height: 1.6; color: #1f2937; }
[data-freelab-theme="dark"] .freelab .fl-login-note { background: #121a26; border-color: #2a3340; border-left-color: #5b8def; color: #dbe4f0; }

/* ===================== Explicit section/heading colors (theme-independent) ===================== */
/* The active theme can set a dark body + white heading color. Our landing/about
   must not inherit those; assign explicit surfaces and text colors. */
.freelab .lp-section { background: #fff; color: var(--fl-ink); }
.freelab .lp-section.lp-band { background: var(--fl-soft); }
.freelab .lp-section.lp-cta-band { background: linear-gradient(160deg, #0e2740, #123556); color: #fff; }
.freelab .lp-h2 { color: var(--fl-ink); }
.freelab .lp-card h3,
.freelab .lp-steps h3,
.freelab .lp-checks li { color: var(--fl-ink); }
.freelab .lp-card p,
.freelab .lp-steps p,
.freelab .lp-sub { color: var(--fl-muted); }
.freelab .lp-cta-band .lp-h2,
.freelab .lp-cta-band .lp-sub { color: #fff; }

[data-freelab-theme="dark"] .freelab .lp-section { background: #0d1117; }
[data-freelab-theme="dark"] .freelab .lp-section.lp-band { background: var(--fl-soft); }
[data-freelab-theme="dark"] .freelab .lp-h2,
[data-freelab-theme="dark"] .freelab .lp-card h3,
[data-freelab-theme="dark"] .freelab .lp-steps h3,
[data-freelab-theme="dark"] .freelab .lp-checks li { color: var(--fl-ink); }

/* ===================== User Dashboard (我的工作) ===================== */
.fl-dash { min-height: 100vh; background: #f6f7f9; color: var(--fl-ink); }
.fl-dash-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 12px clamp(16px, 4vw, 40px); background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid #e2e8f0; }
.fl-dash-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: #0f172a; }
.fl-dash-brand .fl-brand-mark { width: 18px; height: 18px; border-radius: 5px; }
.fl-dash-nav { margin-left: auto; }
.fl-dash-topcta { padding: 9px 16px; font-size: 14px; }
.fl-dash-main { max-width: var(--fl-shell-max, 1200px); margin: 0 auto; padding: 26px 20px 64px; }
.fl-dash-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, #0b1220 0%, #1e293b 58%, #334155 100%); color: #fff; border-radius: 20px; padding: 28px 30px; box-shadow: 0 18px 45px rgba(2,6,23,.16); }
.fl-dash-eyebrow { margin: 0 0 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #93c5fd; }
.fl-dash-hero h1 { color: #fff; margin: 0 0 6px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.4px; }
.fl-dash-sub { color: #cbd5e1; margin: 0; }
.fl-dash-hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fl-dash-plan { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24); border-radius: 999px; padding: 6px 12px; font-size: 12px; color: #e2e8f0; }
.fl-dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin: 16px 0; }
.fl-dash-stat { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.fl-dash-stat-label { font-size: 12px; color: #64748b; letter-spacing: .02em; }
.fl-dash-stat b { display: block; font-size: 30px; line-height: 1.1; color: #0f172a; margin: 2px 0; }
.fl-dash-stat b small { font-size: 14px; color: #94a3b8; font-weight: 500; }
.fl-dash-stat-hint { font-size: 11.5px; color: #94a3b8; }
.fl-dash-bar { height: 6px; background: #eef2f7; border-radius: 999px; overflow: hidden; margin: 8px 0 6px; }
.fl-dash-bar span { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); }
.fl-dash-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 16px; align-items: start; }
.fl-dash-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(15,23,42,.05); margin-bottom: 16px; }
.fl-dash-panel-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fl-dash-panel-h h2 { font-size: 15px; margin: 0; letter-spacing: -.1px; }
.fl-dash-panel-h a { font-size: 12.5px; text-decoration: none; color: #2563eb; }
.fl-dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.fl-dash-card { border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; background: linear-gradient(180deg, #fff, #fbfdff); transition: .15s; }
.fl-dash-card:hover { box-shadow: 0 10px 24px rgba(15,23,42,.09); transform: translateY(-1px); }
.fl-dash-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fl-dash-card h3 { font-size: 15px; margin: 0; color: #0f172a; }
.fl-dash-plat { font-size: 11px; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 2px 8px; }
.fl-dash-meta { color: #64748b; font-size: 12px; margin: 6px 0 4px; }
.fl-dash-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.fl-dash-card-actions { margin-top: 8px; }
.freelab-btn.small { padding: 8px 14px; font-size: 13.5px; }
.fl-dash-links { list-style: none; margin: 0; padding: 0; }
.fl-dash-links li { border-bottom: 1px solid #f1f5f9; }
.fl-dash-links li:last-child { border-bottom: none; }
.fl-dash-links a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px; text-decoration: none; color: #0f172a; font-size: 13.5px; }
.fl-dash-links a span { color: #94a3b8; font-size: 12px; }
.fl-dash-links a:hover { color: #2563eb; }
.fl-dash-pending { list-style: disc; margin: 6px 0 0; padding-left: 20px; color: #334155; font-size: 13px; }
.fl-dash-pending li { margin: 4px 0; }
.fl-dash-note p { color: #475569; font-size: 13px; line-height: 1.6; margin: 6px 0; }
.fl-dash-empty { text-align: center; padding: 42px 12px; }
.fl-dash-empty-mark { font-size: 30px; color: #cbd5e1; }
.fl-dash-empty h3 { margin: 8px 0 4px; }
.fl-dash-empty p { color: #64748b; margin: 0 0 14px; }
.fl-dash-empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.fl-dash .freelab-footer { max-width: var(--fl-shell-max, 1200px); margin: 0 auto; padding: 18px 20px 30px; }
@media (max-width: 1000px) { .fl-dash-grid { grid-template-columns: 1fr; } .fl-dash-stats { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .fl-dash-hero { padding: 22px; } }

[data-freelab-theme="dark"] .fl-dash { background: #0d1117; }
[data-freelab-theme="dark"] .fl-dash-top { background: rgba(13,17,23,.9); border-bottom-color: #2a3340; }
[data-freelab-theme="dark"] .fl-dash-brand { color: var(--fl-ink); }
[data-freelab-theme="dark"] .fl-dash-stat,
[data-freelab-theme="dark"] .fl-dash-panel,
[data-freelab-theme="dark"] .fl-dash-card { background: #161b22; border-color: #2a3340; color: var(--fl-ink); }
[data-freelab-theme="dark"] .fl-dash-stat b,
[data-freelab-theme="dark"] .fl-dash-card h3,
[data-freelab-theme="dark"] .fl-dash-links a { color: var(--fl-ink); }
[data-freelab-theme="dark"] .fl-dash-bar { background: #232b36; }
[data-freelab-theme="dark"] .fl-dash-card { background: linear-gradient(180deg, #161b22, #12161d); }

/* ===================== Unified site canvas (header/footer/page) ===================== */
.fl-site { min-height: 100vh; background: #f6f7f9; color: var(--fl-ink); }
.fl-site-head { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid #e2e8f0; }
.fl-site-head-inner { max-width: var(--fl-shell-max, 1200px); margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 12px 20px; }
.fl-site-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: #0f172a; }
.fl-site-brand .fl-brand-mark { width: 18px; height: 18px; border-radius: 5px; }
.fl-site-nav { margin-left: auto; }
.fl-site-actions { display: flex; gap: 8px; align-items: center; }
.freelab-btn.small { padding: 8px 14px; font-size: 13.5px; }
.fl-page { padding: 0; }
.fl-page-woo { max-width: var(--fl-shell-max, 1200px); margin: 0 auto; padding: 26px 20px 64px; }
.fl-site-foot { max-width: var(--fl-shell-max, 1200px); margin: 0 auto; padding: 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid #e2e8f0; color: #64748b; font-size: 13px; }
.fl-site-foot a { color: inherit; text-decoration: none; }
.fl-site-foot a:hover { color: #2563eb; }
.fl-site-foot-links { display: flex; gap: 14px; }

/* App page: keep its own full-screen topbar; hide the site header/footer. */
.fl-app-page .fl-site-head, .fl-app-page .fl-site-foot { display: none; }

/* Account */
.fl-account { max-width: var(--fl-shell-max, 1200px); margin: 0 auto; padding: 26px 20px 64px; }
.fl-acc-hero { margin-bottom: 16px; }
.fl-acc-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 16px; align-items: start; }
.fl-acc-form { display: grid; gap: 12px; max-width: 520px; }
.fl-acc-info { list-style: none; margin: 0; padding: 0; }
.fl-acc-info li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.fl-acc-info li:last-child { border-bottom: none; }
.fl-acc-info span { color: #64748b; }
.fl-acc-msg { margin: 12px 0; }
.fl-msg.error { color: #991b1b; background: #fef2f2; border-color: #fecaca; }

/* WooCommerce inside the unified canvas */
.fl-page-woo .woocommerce-products-header__title { font-size: 28px; }
.fl-page-woo .woocommerce ul.products li.product { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.fl-page-woo .woocommerce a.button,
.fl-page-woo .woocommerce button.button,
.fl-page-woo .woocommerce input.button { background: linear-gradient(180deg,#3b82f6,#2563eb); color: #fff; border: none; border-radius: 10px; }
.fl-page-woo .woocommerce a.button:hover,
.fl-page-woo .woocommerce button.button:hover { background: linear-gradient(180deg,#2563eb,#1d4ed8); color: #fff; }
.fl-page-woo .woocommerce-message { border-top-color: #2563eb; }

@media (max-width: 1000px) { .fl-acc-grid { grid-template-columns: 1fr; } .fl-site-nav { display: none; } }

[data-freelab-theme="dark"] .fl-site { background: #0d1117; }
[data-freelab-theme="dark"] .fl-site-head { background: rgba(13,17,23,.9); border-bottom-color: #2a3340; }
[data-freelab-theme="dark"] .fl-site-brand { color: var(--fl-ink); }
[data-freelab-theme="dark"] .fl-site-foot { border-top-color: #2a3340; }
[data-freelab-theme="dark"] .fl-page-woo .woocommerce ul.products li.product { background: #161b22; border-color: #2a3340; }
[data-freelab-theme="dark"] .fl-acc-info li { border-bottom-color: #2a3340; }

/* ===================== Brand identity + motion ===================== */
.fl-brand-mark { background: url('../img/freelab-mark.svg') center / contain no-repeat !important; border-radius: 6px; }
.fl-site-name { font-weight: 700; }
.fl-site-by { font-size: 11px; color: #64748b; border: 1px solid #e2e8f0; border-radius: 999px; padding: 1px 8px; margin-left: 6px; white-space: nowrap; }
[data-freelab-theme="dark"] .fl-site-by { color: #9aa4b2; border-color: #2a3340; }

@keyframes fl-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fl-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.fl-dash-hero { position: relative; overflow: hidden; }
.fl-dash-hero::after { content: ""; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px; background: radial-gradient(circle, rgba(96,165,250,.45), transparent 65%); animation: fl-float 7s ease-in-out infinite; pointer-events: none; }
.fl-dash-stat, .fl-dash-panel, .fl-dash-card, .fl-rm-stat, .fl-rm-col, .fl-rm-focus { animation: fl-fade-up .45s ease both; }
.fl-dash-stat:nth-child(2) { animation-delay: .05s; }
.fl-dash-stat:nth-child(3) { animation-delay: .1s; }
.fl-dash-stat:nth-child(4) { animation-delay: .15s; }
.freelab-btn { transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.freelab-btn:hover { transform: translateY(-1px); }
.fl-dash-bar span { transition: width .6s ease; }
.fl-rm-meter { height: 6px; background: #eef2f7; border-radius: 999px; overflow: hidden; min-width: 72px; margin: 8px 0 4px; }
.fl-rm-meter span { display: block; height: 100%; background: linear-gradient(90deg, #34d399, #2563eb); }
[data-freelab-theme="dark"] .fl-rm-meter { background: #232b36; }
@media (prefers-reduced-motion: reduce) { .fl-dash-hero::after { animation: none; } .fl-dash-stat, .fl-dash-panel, .fl-dash-card, .fl-rm-stat, .fl-rm-col, .fl-rm-focus { animation: none; } }

/* Roadmap filters */
.fl-rm-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 16px 0 10px; padding: 12px 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; }
.fl-rm-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #64748b; }
.fl-rm-filters select, .fl-rm-filters input { height: 32px; border-radius: 8px; }
.fl-rm-filters .fl-rm-search input { min-width: 220px; }
.fl-rm-shown { margin-left: auto; font-size: 12px; color: #64748b; }

/* Empty-state illustrations + skeleton shimmer */
.fl-empty-illu { width: 160px; max-width: 70%; height: auto; display: block; margin: 0 auto 10px; }
@keyframes fl-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.fl-skel-line { background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%); background-size: 400% 100%; animation: fl-shimmer 1.3s ease-in-out infinite; border-radius: 6px; }
.fl-skel { display: grid; gap: 10px; }
[data-freelab-theme="dark"] .fl-skel-line { background: linear-gradient(90deg, #1b2230 25%, #232b36 37%, #1b2230 63%); background-size: 400% 100%; }
@media (prefers-reduced-motion: reduce) { .fl-skel-line { animation: none; } }

/* Brand lockup (Chinese name + slogan) */
.fl-site-brand { display: flex; align-items: center; gap: 10px; }
.fl-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.fl-brand-line1 { font-weight: 700; font-size: 16px; color: #0f172a; }
.fl-brand-cn { font-weight: 600; color: #334155; margin-left: 4px; }
.fl-brand-line2 { font-size: 11px; color: #64748b; letter-spacing: .02em; }
[data-freelab-theme="dark"] .fl-brand-line1 { color: var(--fl-ink); }
[data-freelab-theme="dark"] .fl-brand-cn { color: #cbd5e1; }
[data-freelab-theme="dark"] .fl-brand-line2 { color: #9aa4b2; }
@media (max-width: 980px) { .fl-brand-line2 { display: none; } }

/* Site shell must escape the base .freelab 960px cap. */
.fl-site { max-width: none; width: 100%; margin: 0; }

/* ===================== Avatars ===================== */
.fl-avatar { border-radius: 50%; background: #eef2f7; object-fit: cover; border: 1px solid rgba(15,23,42,.08); vertical-align: middle; }
.fl-avatar-lg { width: 56px; height: 56px; border-radius: 16px; }
.fl-avatar-link { display: inline-flex; align-items: center; }
.fl-dash-hero-id { display: flex; align-items: center; gap: 14px; }
.fl-avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; max-width: 520px; }
.fl-avatar-opt { position: relative; cursor: pointer; display: block; }
.fl-avatar-opt input { position: absolute; opacity: 0; pointer-events: none; }
.fl-avatar-opt img { width: 100%; height: auto; border-radius: 12px; display: block; outline: 2px solid transparent; transition: .15s; }
.fl-avatar-opt input:checked + img { outline-color: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,.18); }
.fl-avatar-opt:hover img { transform: translateY(-1px); }
.fl-time-online-list { display: flex; gap: 10px; flex-wrap: wrap; }
.fl-time-userchip { display: inline-flex; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 999px; padding: 4px 10px 4px 4px; font-size: 12.5px; color: #0f172a; }
.fl-time-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #16a34a; font-weight: 600; margin-left: 8px; }
.fl-time-live i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.16); animation: fl-pulse 1.8s ease-in-out infinite; }
@keyframes fl-pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.fl-time-name { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 640px) { .fl-avatar-grid { grid-template-columns: repeat(6, 1fr); } }
[data-freelab-theme="dark"] .fl-time-userchip { background: #161b22; border-color: #2a3340; color: var(--fl-ink); }

/* Account avatar series + upload + profile avatar */
.fl-avatar-current { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.fl-avatar-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.fl-avatar-tab { border: 1px solid #cbd5e1; background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 12px; cursor: pointer; color: #334155; }
.fl-avatar-tab[aria-selected="true"] { background: #0f172a; border-color: #0f172a; color: #fff; }
.fl-avatar-series .fl-avatar-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.fl-avatar-upload { margin-top: 14px; padding-top: 14px; border-top: 1px solid #f1f5f9; }
.fl-acc-inline { display: inline-block; margin-top: 8px; }
.fl-radio { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: #334155; }
.fl-avatar-req { margin-top: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; font-size: 12.5px; color: #475569; }
.fl-avatar-req ul { margin: 6px 0 0; padding-left: 18px; }
[data-freelab-theme="dark"] .fl-avatar-tab { background: #161b22; border-color: #2a3340; color: var(--fl-ink); }
[data-freelab-theme="dark"] .fl-avatar-tab[aria-selected="true"] { background: #2563eb; border-color: #2563eb; color: #fff; }
[data-freelab-theme="dark"] .fl-avatar-upload { border-top-color: #2a3340; }
[data-freelab-theme="dark"] .fl-avatar-req { background: #12161d; border-color: #2a3340; color: #cbd5e1; }

/* Profile preview in the optimizer */
.fl-preview { border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px 18px; background: linear-gradient(180deg,#fff,#fbfdff); box-shadow: 0 1px 2px rgba(15,23,42,.05); margin: 14px 0 6px; animation: fl-fade-up .4s ease both; }
.fl-preview-head { display: flex; align-items: center; gap: 12px; }
.fl-preview-name { font-weight: 700; color: #0f172a; }
.fl-preview-plat { font-size: 11.5px; color: #64748b; }
.fl-preview-tag { margin-left: auto; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #2563eb; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 999px; padding: 2px 8px; }
.fl-preview-headline { margin: 12px 0 4px; font-size: 17px; color: #0f172a; }
.fl-preview-line { margin: 0 0 8px; color: #64748b; font-size: 12.5px; }
.fl-preview-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.fl-preview-chip { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; color: #334155; }
.fl-preview-content { margin: 8px 0 0; color: #475569; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; }
[data-freelab-theme="dark"] .fl-preview { background: #12161d; border-color: #2a3340; }
[data-freelab-theme="dark"] .fl-preview-name, [data-freelab-theme="dark"] .fl-preview-headline { color: var(--fl-ink); }
[data-freelab-theme="dark"] .fl-preview-content { color: #cbd5e1; }
[data-freelab-theme="dark"] .fl-preview-chip { background: #1b2230; border-color: #2a3340; color: #cbd5e1; }

/* Branded login */
.fl-login-brand { max-width: 460px; margin: 0 auto; padding: 32px 20px 64px; }
.fl-login-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; padding: 26px 24px; box-shadow: 0 18px 45px rgba(2,6,23,.08); }
.fl-login-logo { width: 44px; height: 44px; display: block; margin-bottom: 10px; }
.fl-login-card h1 { margin: 0 0 4px; font-size: 24px; color: #0f172a; }
.fl-login-form { display: grid; gap: 12px; margin-top: 14px; }
.fl-login-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #475569; }
.fl-login-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 13px; flex-wrap: wrap; }
.fl-login-links a { color: #2563eb; text-decoration: none; }
.fl-login-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
[data-freelab-theme="dark"] .fl-login-card { background: #161b22; border-color: #2a3340; }
[data-freelab-theme="dark"] .fl-login-card h1 { color: var(--fl-ink); }
