/* ==========================================================================
   Flight Logbook - styles
   Aesthetic: a quiet instrument panel. Dark slate, avionics status lights
   (green/amber/red), tabular figures for numbers. Mobile-first.
   All selectors are scoped under #flight-logbook-app so nothing leaks into
   the rest of your WordPress theme.
   ========================================================================== */

#flight-logbook-app {
	--bg:        #0e1620;   /* panel background        */
	--bg-2:      #16212e;   /* raised card             */
	--bg-3:      #1e2c3c;   /* input / hover           */
	--line:      #2a3a4d;   /* hairline borders        */
	--ink:       #e7eef5;   /* primary text            */
	--ink-dim:   #90a4b8;   /* secondary text          */
	--ink-faint: #5f7387;   /* placeholder text        */
	--cyan:      #38bdf8;   /* primary accent          */
	--cyan-deep: #0e7490;
	--green:     #34d399;   /* status: good / current  */
	--amber:     #fbbf24;   /* status: caution         */
	--red:       #f87171;   /* status: warning / lapsed*/
	--radius:    12px;
	--mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, monospace;
	--sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 15px;
	line-height: 1.5;
	border-radius: var(--radius);
	padding: 0;
	max-width: 1100px;
	margin: 0 auto;
	overflow: hidden;
	box-shadow: 0 0 0 1px var(--line);
}
#flight-logbook-app *, #flight-logbook-app *::before, #flight-logbook-app *::after { box-sizing: border-box; }
#flight-logbook-app h1, #flight-logbook-app h2, #flight-logbook-app h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

/* ---- Header + hamburger + drawer ---------------------------------------- */
.fl-header {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.fl-header .fl-title { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.fl-header-brand { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.fl-brandlogo { width: 30px; height: 30px; object-fit: contain; }
.fl-hamburger { appearance: none; background: none; border: 0; cursor: pointer; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.fl-hamburger span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }
.fl-hamburger:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

.fl-drawer-overlay { position: fixed; inset: 0; background: rgba(4,10,16,.55); z-index: 10000; opacity: 0; transition: opacity .2s; }
.fl-drawer-overlay.show { opacity: 1; }
.fl-drawer {
	position: fixed; top: 0; left: 0; bottom: 0; width: 260px; max-width: 82vw; z-index: 10001;
	background: var(--bg-2); border-right: 1px solid var(--line);
	transform: translateX(-105%); transition: transform .2s ease;
	display: flex; flex-direction: column; padding: 16px 12px;
}
.fl-drawer.open { transform: translateX(0); }
.fl-drawer-head { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.fl-drawer-head img { width: 30px; height: 30px; object-fit: contain; }
.fl-drawer-head span { font-weight: 600; font-size: 17px; }
.fl-menu { list-style: none; margin: 0; padding: 0; flex: 1; }
.fl-menu li { margin: 2px 0; }
.fl-menuitem { width: 100%; text-align: left; appearance: none; background: none; border: 0; cursor: pointer;
	color: var(--ink-dim); font-family: var(--sans); font-size: 15px; font-weight: 500; padding: 11px 12px; border-radius: 9px; }
.fl-menuitem:hover { background: var(--bg-3); color: var(--ink); }
.fl-menuitem.active { background: var(--bg-3); color: var(--cyan); }
.fl-drawer-foot { border-top: 1px solid var(--line); padding-top: 10px; }
.fl-byline { text-align: center; color: var(--ink-faint); font-size: 11px; margin-top: 8px; letter-spacing: .04em; }

/* ---- Login (clean fade / rise) ------------------------------------------ */
.fl-login { max-width: 340px; margin: 0 auto; padding: 2vh 24px 32px; text-align: center; }
.fl-login-badge { position: relative; width: 128px; height: 128px; margin: 7vh auto 6px; }
.fl-login-glow { position: absolute; left: 50%; top: 50%; width: 140px; height: 140px; transform: translate(-50%,-50%); border-radius: 50%; z-index: 0;
	background: radial-gradient(circle, rgba(240,180,41,.26), rgba(240,180,41,0) 68%); filter: blur(14px);
	opacity: 0; animation: bwGlowIn 1s ease .15s forwards, bwGlowBreathe 4.8s ease-in-out 1.1s infinite; }
.fl-login-logo { position: absolute; left: 50%; top: 50%; width: 116px; height: 116px; object-fit: contain; z-index: 1;
	opacity: 0; transform: translate(-50%, calc(-50% + 10px)) scale(.94); animation: bwLogoIn .8s cubic-bezier(.2,.7,.2,1) .1s forwards; }
/* Light-sheen glint that sweeps across the logo, masked to the logo's shape */
.fl-login-sheen { position: absolute; left: 50%; top: 50%; width: 116px; height: 116px; transform: translate(-50%,-50%); z-index: 2; pointer-events: none;
	background: linear-gradient(115deg, rgba(255,255,255,0) 38%, rgba(255,255,255,.65) 50%, rgba(255,255,255,0) 62%);
	background-size: 260% 100%; background-repeat: no-repeat; background-position: 160% 0; opacity: 0;
	-webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
	animation: bwSheen 5s ease 1s infinite; }
.fl-login-brand { font-size: 25px; font-weight: 600; letter-spacing: -0.01em; margin: 14px 0 22px;
	opacity: 0; animation: bwFade .6s ease .5s forwards; }
.fl-login-form { opacity: 0; animation: bwFade .6s ease .72s forwards; }
.fl-login .fl-field { text-align: left; }
.fl-login-err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }

.fl-login.signing .fl-login-logo { animation: bwBreathe 1.1s ease-in-out infinite; }
.fl-login.signing .fl-login-sheen { animation-duration: 1.2s; animation-delay: 0s; }
.fl-login.success .fl-login-badge { animation: bwSuccess .5s ease; }
.fl-login-badge.shake { animation: bwShake .4s ease; }

@keyframes bwGlowIn { to { opacity: .6; } }
@keyframes bwLogoIn { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes bwSheen { 0% { opacity: 0; background-position: 160% 0; } 7% { opacity: 1; } 24% { opacity: 0; background-position: -60% 0; } 100% { opacity: 0; background-position: -60% 0; } }
@keyframes bwGlowBreathe { 0%, 100% { opacity: .5; } 50% { opacity: .8; } }
@keyframes bwFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes bwBreathe { 0%, 100% { transform: translate(-50%,-50%) scale(1); opacity: 1; } 50% { transform: translate(-50%,-50%) scale(1.04); opacity: .82; } }
@keyframes bwSuccess { 0% { transform: scale(1); } 30% { transform: scale(1.09); } 100% { transform: scale(1); } }
@keyframes bwShake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@media (prefers-reduced-motion: reduce) {
	.fl-login-logo { animation: none; opacity: 1; transform: translate(-50%,-50%); }
	.fl-login-sheen { display: none; }
	.fl-login-glow { animation: none; opacity: .55; }
	.fl-login-brand, .fl-login-form { animation: none; opacity: 1; transform: none; }
	.fl-login.signing .fl-login-logo { animation: none; }
}

/* ---- Summary sub-tabs --------------------------------------------------- */
.fl-subtabs { display: flex; gap: 6px; margin-bottom: 20px; padding-bottom: 14px;
	border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fl-subtab { appearance: none; cursor: pointer; font-family: var(--sans); font-size: 13px; font-weight: 600; white-space: nowrap; flex: none;
	border-radius: 8px; border: 1px solid var(--line); background: var(--bg-3); color: var(--ink-dim); padding: 7px 12px; }
.fl-subtab:hover { color: var(--ink); }
.fl-subtab.active { background: var(--cyan); color: #04141d; border-color: var(--cyan); }

.fl-view { padding: 18px; }
.fl-view[hidden] { display: none; }

/* ---- Buttons ------------------------------------------------------------- */
.fl-btn {
	appearance: none; cursor: pointer; font-family: var(--sans); font-weight: 600; font-size: 14px;
	border-radius: 9px; border: 1px solid var(--line); background: var(--bg-3); color: var(--ink);
	padding: 9px 14px; transition: border-color .15s, background .15s;
}
.fl-btn:hover { border-color: var(--cyan-deep); }
.fl-btn.primary { background: var(--cyan); color: #04141d; border-color: var(--cyan); }
.fl-btn.primary:hover { filter: brightness(1.05); }
.fl-btn.ghost { background: transparent; }
.fl-btn.danger { color: var(--red); border-color: #4a2530; }
.fl-btn.small { padding: 5px 9px; font-size: 12.5px; }
.fl-btn:focus-visible, .fl-tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---- Forms --------------------------------------------------------------- */
.fl-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.fl-field label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-dim); }
.fl-input, .fl-select, .fl-textarea {
	width: 100%; background: var(--bg-3); color: var(--ink);
	border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px;
	font-family: var(--sans); font-size: 15px;
}
.fl-input:focus, .fl-select:focus, .fl-textarea:focus { outline: none; border-color: var(--cyan); }
.fl-input::placeholder { color: var(--ink-faint); }
.fl-textarea { resize: vertical; min-height: 46px; }
.fl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fl-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
input[type="number"].fl-input { font-family: var(--mono); }

.fl-card {
	background: var(--bg-2); border: 1px solid var(--line);
	border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.fl-card > h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-dim); margin-bottom: 12px; }

/* ---- Condition rows (the multi-condition sortie splitter) ---------------- */
.fl-cond-row {
	display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
	background: var(--bg-3); border: 1px solid var(--line);
	border-radius: 10px; padding: 12px; margin-bottom: 10px; position: relative;
}
.fl-cond-row .fl-field { margin-bottom: 0; }
.fl-cond-row .full { grid-column: 1 / -1; }
.fl-cond-remove {
	position: absolute; top: 8px; right: 8px; background: none; border: 0; cursor: pointer;
	color: var(--ink-faint); font-size: 18px; line-height: 1; padding: 2px 6px;
}
.fl-cond-remove:hover { color: var(--red); }
.fl-rowsum { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); margin: 4px 2px 14px; }
.fl-rowsum b { color: var(--cyan); }

/* ---- Requirement checkboxes on the entry form --------------------------- */
.fl-reqchecks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fl-reqchecks label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink);
	background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.fl-reqchecks input { accent-color: var(--cyan); width: 16px; height: 16px; }

/* ---- Master log table ---------------------------------------------------- */
.fl-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.fl-toolbar .spacer { flex: 1; }
.fl-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.fl-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
table.fl-table th, table.fl-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.fl-table th { position: sticky; top: 0; background: var(--bg-2); color: var(--ink-dim);
	font-size: 11px; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; user-select: none; }
table.fl-table th:hover { color: var(--ink); }
table.fl-table th[data-dir="asc"]::after  { content: " ▲"; color: var(--cyan); }
table.fl-table th[data-dir="desc"]::after { content: " ▼"; color: var(--cyan); }
table.fl-table td.num { font-family: var(--mono); text-align: right; }
table.fl-table tbody tr:hover { background: var(--bg-3); }
.fl-pill { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 1px 7px; border-radius: 20px; border: 1px solid var(--line); }
.fl-pill.cond-D  { color: var(--amber); }
.fl-pill.cond-N  { color: #a5b4fc; }
.fl-pill.cond-NG { color: var(--green); }
.fl-pill.cond-H, .fl-pill.cond-W { color: var(--cyan); }
.fl-pill.cond-Mx { color: var(--ink-dim); }
.fl-rowbtns { display: flex; gap: 6px; }

/* ---- Summary: stat grid + status cards ---------------------------------- */
.fl-statgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.fl-stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.fl-stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-dim); }
.fl-stat .v { font-family: var(--mono); font-size: 22px; font-weight: 600; margin-top: 2px; }
.fl-stat .v small { font-size: 12px; color: var(--ink-dim); font-weight: 400; }

.fl-reqcard {
	display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center;
	background: var(--bg-2); border: 1px solid var(--line); border-left: 0;
	border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; position: relative; overflow: hidden;
}
.fl-reqcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.fl-reqcard.status-green::before  { background: var(--green); box-shadow: 0 0 12px var(--green); }
.fl-reqcard.status-amber::before  { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.fl-reqcard.status-red::before    { background: var(--red);   box-shadow: 0 0 12px var(--red);   }
.fl-reqcard .dot { width: 10px; height: 10px; border-radius: 50%; }
.fl-reqcard.status-green .dot { background: var(--green); }
.fl-reqcard.status-amber .dot { background: var(--amber); }
.fl-reqcard.status-red .dot   { background: var(--red); }
.fl-reqcard .body .name { font-weight: 600; }
.fl-reqcard .body .detail { font-size: 12.5px; color: var(--ink-dim); margin-top: 2px; }
.fl-reqcard .metric { font-family: var(--mono); text-align: right; font-size: 13px; }
.fl-reqcard .metric b { font-size: 17px; }
.fl-progress { height: 5px; background: var(--bg-3); border-radius: 3px; margin-top: 7px; overflow: hidden; }
.fl-progress > i { display: block; height: 100%; }
.status-green .fl-progress > i { background: var(--green); }
.status-amber .fl-progress > i { background: var(--amber); }
.status-red   .fl-progress > i { background: var(--red); }

.fl-windowbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: 12px; }
.fl-windowbar .chip { background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.fl-windowbar .chip span { color: var(--ink-dim); text-transform: uppercase; letter-spacing: .05em; font-size: 10px; display: block; }
.fl-windowbar .chip b { font-family: var(--mono); font-weight: 600; }

.fl-subhead { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--cyan);
	margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

.fl-reqrow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bg-2);
	border: 1px solid var(--line); border-radius: 9px; margin-bottom: 7px; }
.fl-reqrow .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.fl-reqrow.done .dot { background: var(--green); }
.fl-reqrow.todo .dot { background: var(--red); }
.fl-reqrow .name { flex: 1; font-weight: 500; }
.fl-reqrow .when { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }

/* ---- Toast + modal ------------------------------------------------------- */
.fl-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
	background: var(--bg-3); color: var(--ink); border: 1px solid var(--cyan-deep);
	padding: 11px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none;
	transition: opacity .2s, transform .2s; z-index: 9999; }
.fl-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.fl-toast.err { border-color: var(--red); }

.fl-modal { position: fixed; inset: 0; background: rgba(4,10,16,.7); display: flex; align-items: center;
	justify-content: center; padding: 16px; z-index: 9998; }
.fl-modal[hidden] { display: none; }
.fl-modal .box { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 18px; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; }
.fl-modal h3 { margin-bottom: 14px; }
.fl-modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

.fl-hint { font-size: 12.5px; color: var(--ink-dim); margin-top: -4px; margin-bottom: 12px; }
.fl-empty { text-align: center; color: var(--ink-dim); padding: 40px 16px; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 620px) {
	.fl-grid, .fl-grid-3, .fl-statgrid, .fl-reqchecks { grid-template-columns: 1fr; }
	.fl-cond-row { grid-template-columns: 1fr 1fr; }
	.fl-view { padding: 14px; }
	.fl-header .fl-clock { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	#flight-logbook-app * { transition: none !important; }
}

/* ======================================================================
   v1.1.0 additions
   ====================================================================== */

/* Grid cells must be allowed to shrink so date inputs don't overflow on mobile */
.fl-field { min-width: 0; }
.fl-grid, .fl-grid-3 { min-width: 0; }
.fl-input, .fl-select, .fl-textarea { max-width: 100%; box-sizing: border-box; }
/* Mobile date inputs otherwise size to their intrinsic (too-wide) content */
input[type="date"].fl-input, input[type="number"].fl-input {
	-webkit-appearance: none; appearance: none; width: 100%; min-width: 0;
}

/* Collapsible sections (native details) */
details.fl-collapse { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); margin: 14px 0; overflow: hidden; }
details.fl-collapse > summary {
	list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 14.5px; color: var(--ink);
	display: flex; align-items: center; gap: 8px;
}
details.fl-collapse > summary::-webkit-details-marker { display: none; }
details.fl-collapse > summary::before {
	content: "▸"; color: var(--ink-dim); font-size: 12px; transition: transform .15s;
}
details.fl-collapse[open] > summary::before { transform: rotate(90deg); }
details.fl-collapse > summary:hover { background: var(--bg-3); }
.fl-collapse-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }

/* Required-field validation */
.fl-invalid { border-color: var(--red) !important; box-shadow: 0 0 0 2px rgba(248,113,113,.18) !important; }

/* Full-width block button + bigger add-condition button */
.fl-btn.block { width: 100%; justify-content: center; padding: 13px 16px; font-size: 15px; margin-top: 4px; }
.fl-btn.j-addrow { border-style: dashed; }

/* Bigger sortie total */
.fl-rowsum.big { font-size: 15px; margin-top: 12px; }
.fl-rowsum.big b { font-size: 22px; color: var(--cyan); font-family: var(--mono); }

/* Condition row: Hours on its own full-width row; T/O + Landings share a row */
.fl-cond-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; position: relative;
	padding: 16px; padding-top: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); margin-bottom: 12px; }
.fl-cond-row .full { grid-column: 1 / -1; }
.fl-cond-remove { position: absolute; top: 8px; right: 10px; appearance: none; background: none; border: 0; cursor: pointer;
	color: var(--ink-faint); font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.fl-cond-remove:hover { color: var(--red); background: var(--bg-3); }

/* Eval completion rows (editable date) — stay on one line */
.fl-reqrow { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line);
	border-radius: 10px; background: var(--bg-2); margin-bottom: 7px; flex-wrap: nowrap; }
.fl-reqrow .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.fl-reqrow.done .dot { background: var(--green); }
.fl-reqrow .name { flex: 1 1 auto; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-reqrow input[type="date"].j-reqdate { flex: none; width: 132px; padding-left: 8px; padding-right: 6px; }
.fl-reqrow .fl-btn { flex: none; }

/* Small footnote (sim cap, etc.) */
.fl-foot { font-size: 12px; color: var(--ink-dim); margin: -4px 0 10px; padding-left: 2px; }

/* Option editor pills */
.optpill { display: inline-flex; align-items: center; gap: 6px; margin: 0 4px 6px 0; }
.optpill .j-delopt { appearance: none; background: none; border: 0; cursor: pointer; color: var(--ink-faint); font-size: 15px; line-height: 1; padding: 0 2px; }
.optpill .j-delopt:hover { color: var(--red); }
.optadd { display: flex; gap: 8px; margin-top: 8px; }
.optadd .fl-input { max-width: 220px; }

/* ---- Trends charts ------------------------------------------------------ */
.fl-chart { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.fl-chart-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.fl-chart-2 > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.fl-chart-2 .fl-subhead { margin-top: 0; }
.fl-svg { width: 100%; height: auto; display: block; }
.fl-svg .cval { fill: var(--ink-dim); font-size: 10px; text-anchor: middle; font-family: var(--mono); }
.fl-svg .cval2 { fill: var(--ink-dim); font-size: 11px; font-family: var(--mono); dominant-baseline: middle; }
.fl-svg .cax { fill: var(--ink-faint); font-size: 10px; text-anchor: middle; }
.fl-svg .clbl { fill: var(--ink-dim); font-size: 11.5px; dominant-baseline: middle; }
.fl-svg .cgrid { stroke: var(--line); stroke-width: 1; }
.fl-svg .cmid { fill: var(--ink); font-size: 20px; font-weight: 600; text-anchor: middle; font-family: var(--mono); }
.fl-donut { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.fl-donut .fl-svg { width: 160px; flex: none; }
.fl-legend { flex: 1; min-width: 140px; }
.fl-leg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-dim); margin: 4px 0; }
.fl-leg span { width: 12px; height: 12px; border-radius: 3px; flex: none; }

@media (max-width: 640px) {
	.fl-chart-2 { grid-template-columns: 1fr; }
	.fl-cond-row { grid-template-columns: 1fr 1fr; }
}

/* ---- Scroll to top (global) --------------------------------------------- */
.fl-scrolltop {
	position: fixed; bottom: 26px; right: 26px; z-index: 9000;
	width: 46px; height: 46px; border-radius: 50%;
	background: var(--bg-3); border: 1px solid var(--line); color: var(--cyan);
	display: flex; align-items: center; justify-content: center; cursor: pointer;
	box-shadow: 0 6px 20px rgba(0,0,0,.35);
	opacity: 0; transform: translateY(12px); pointer-events: none;
	transition: opacity .25s, transform .25s, background .2s, border-color .2s, color .2s;
}
.fl-scrolltop.show { opacity: 1; transform: none; pointer-events: auto; }
.fl-scrolltop:hover { background: var(--cyan); border-color: var(--cyan); color: #04141d; }
@media (max-width: 640px) { .fl-scrolltop { bottom: 18px; right: 18px; } }
@media (prefers-reduced-motion: reduce) { .fl-scrolltop { transition: opacity .2s; transform: none; } }
