/*
 * Lume icons — B 螢光雙色 (docs/core/plans/UI_ICON_LIBRARY_PLAN.md §3).
 * Global, not scoped: UiIcon draws the parts, and the Cloud apps and the
 * landing page share this file verbatim. The two theme colours come from the
 * host app — `--color-primary-light` (the duotone fill) and `--color-surface`
 * (the knock-out of an "on" icon) — so a theme change reaches the icons and no
 * brand colour is written here (`themeTokenGuard.test.ts`). The colours that do
 * not follow the theme (gold spark, flame, danger, success) keep a fallback.
 *
 * Part classes (set in shapes/*.json):
 *   ln  line            fl  duotone fill       dt  inner detail line
 *   dd  solid detail    sp  gold spark         sand  hourglass sand
 *   lamp  firefly lantern   fx  currency flame   fcore  flame core   fember  ember
 */

.lume-icon {
  --lume-icon-stroke: 1.6;
  --lume-icon-fill-opacity: 0.3;
  display: inline-block;
  flex: none;
  vertical-align: -0.15em;
  overflow: visible;
}

.lume-icon .ln,
.lume-icon .dt {
  fill: none;
  stroke: currentColor;
  stroke-width: var(--lume-icon-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lume-icon .fl,
.lume-icon .ln.fl {
  fill: var(--lume-icon-duo, var(--color-primary-light));
  fill-opacity: var(--lume-icon-fill-opacity);
}

.lume-icon .dd { fill: currentColor; stroke: none; }
.lume-icon .sand { fill: var(--lume-icon-duo, var(--color-primary-light)); fill-opacity: 0.8; stroke: none; }
.lume-icon .sp { fill: var(--color-spark, #ffd180); stroke: none; }
.lume-icon .lamp {
  fill: var(--color-spark, #ffd180);
  fill-opacity: 0.7;
  stroke: currentColor;
  stroke-width: var(--lume-icon-stroke);
}
.lume-icon .fx { fill: url(#lume-icon-flame) var(--color-spark, #ffd180); stroke: none; }
.lume-icon .fcore { fill: #fff6e2; stroke: none; }
.lume-icon .fember { fill: var(--color-spark, #ffd180); stroke: none; }

/* Rule 4: only sparks, the lantern and the flame glow. */
.lume-icon :is(.sp, .lamp, .fx, .fember) { filter: var(--lume-icon-glow, url(#lume-icon-glow)); }

/* Rule 2: size tiers. */
.lume-icon--sm { --lume-icon-stroke: 1.8; --lume-icon-fill-opacity: 0.2; --lume-icon-glow: none; }

/* Rule 3: states. */
.lume-icon--state-current { color: var(--color-primary-light); --lume-icon-fill-opacity: 0.5; }
.lume-icon--state-on { color: var(--color-primary-light); }
.lume-icon--state-on :is(.fl, .ln.fl) {
  fill: var(--lume-icon-duo, var(--color-primary-light));
  fill-opacity: 1;
}
.lume-icon--state-on .dt { stroke: var(--lume-icon-knockout, var(--color-surface)); }
.lume-icon--state-on .dd { fill: var(--lume-icon-knockout, var(--color-surface)); }
.lume-icon--state-off { opacity: 0.4; --lume-icon-glow: none; }

/* Rule 1: where the colour carries meaning, the fill follows the line (after states, so a tone keeps its colour). */
.lume-icon--tone-danger { color: var(--color-danger, #ff7875); --lume-icon-duo: currentColor; }
.lume-icon--tone-success { color: var(--color-success, #5fd5a4); --lume-icon-duo: currentColor; }
.lume-icon--tone-spark { color: var(--color-spark, #ffd180); --lume-icon-duo: currentColor; }
.lume-icon--tone-current { --lume-icon-duo: currentColor; }

@media (forced-colors: active) {
  .lume-icon :is(.fl, .ln.fl, .sand) { fill: none; }
  .lume-icon :is(.sp, .fx, .fcore, .fember, .dd) { fill: CanvasText; }
  .lume-icon .lamp { fill: none; }
}
