.fwlc-root {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(280px, 1.08fr);
  overflow: hidden;
  border: 1px solid rgba(20, 31, 44, 0.16);
  border-radius: 8px;
  background: #f8fbfd;
  color: #172033;
  box-shadow: 0 18px 44px rgba(28, 45, 68, 0.12);
}

.fwlc-panel {
  padding: 1rem;
  background: linear-gradient(180deg, #fff, #eef6f8);
  border-right: 1px solid rgba(31, 57, 83, 0.12);
}

.fwlc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  color: #167c7a;
  font-size: 0.8rem;
  font-weight: 800;
}

.fwlc-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 176px);
  padding: 0.2rem;
  border: 1px solid rgba(31, 57, 83, 0.16);
  border-radius: 8px;
  background: #e9f2f5;
}

.fwlc-segment button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #526575;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.fwlc-segment button[aria-pressed="true"] {
  background: #16c4b8;
  color: #fff;
}

.fwlc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.fwlc-field {
  display: grid;
  gap: 0.35rem;
  color: #526575;
  font-size: 0.78rem;
  font-weight: 800;
}

.fwlc-wide {
  grid-column: 1 / -1;
}

.fwlc-field input,
.fwlc-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(31, 57, 83, 0.18);
  border-radius: 8px;
  background: #fff;
  color: #172033;
  padding: 0 0.72rem;
  font: inherit;
  font-size: 0.92rem;
}

.fwlc-field select option {
  background: #fff;
  color: #172033;
}

.fwlc-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(31, 57, 83, 0.18);
  border-radius: 8px;
  background: #fff;
}

.fwlc-input input {
  border: 0;
  background: transparent;
}

.fwlc-input b {
  padding: 0 0.72rem;
  color: #168f87;
  font-size: 0.78rem;
}

.fwlc-slider {
  width: 100%;
  accent-color: #16c4b8;
}

.fwlc-readout {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 100%;
  background:
    linear-gradient(rgba(22, 196, 184, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 196, 184, 0.08) 1px, transparent 1px),
    #f2f8fa;
  background-size: 26px 26px;
}

.fwlc-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.72fr);
  align-items: center;
  gap: 0.3rem;
}

.fwlc-hero {
  padding: 1.2rem;
}

.fwlc-hero span,
.fwlc-kpis span,
.fwlc-formula span {
  display: block;
  color: #637687;
  font-size: 0.76rem;
  font-weight: 800;
}

.fwlc-hero strong {
  display: inline-block;
  margin-top: 0.15rem;
  color: #101827;
  font-size: clamp(2.7rem, 9vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.fwlc-hero em {
  color: #168f87;
  font-style: normal;
  font-weight: 900;
}

.fwlc-spool-card {
  display: grid;
  gap: 0.45rem;
  padding: 1rem 1rem 0.8rem 0;
}

.fwlc-spool-card > span,
.fwlc-ruler + small,
.fwlc-cut-caption {
  color: #637687;
  font-size: 0.72rem;
  font-weight: 800;
}

.fwlc-spool-wrap {
  position: relative;
  width: min(100%, 190px);
  aspect-ratio: 1;
  justify-self: center;
}

.fwlc-spool {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 12px 22px rgba(24, 42, 58, 0.14));
}

.fwlc-spool-shell {
  fill: #dbe7ec;
  stroke: rgba(31, 57, 83, 0.18);
  stroke-width: 2;
}

.fwlc-spool-empty {
  fill: none;
  stroke: rgba(31, 57, 83, 0.11);
  stroke-width: 44;
}

.fwlc-spool-fill {
  fill: none;
  stroke: var(--fwlc-material-color, #16c4b8);
  stroke-linecap: butt;
  stroke-width: 44;
  transform: rotate(-90deg);
  transform-origin: 80px 80px;
  transition: stroke 180ms ease, stroke-dashoffset 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fwlc-spool-hub {
  fill: #f8fbfd;
  stroke: rgba(31, 57, 83, 0.2);
  stroke-width: 2;
}

.fwlc-spool-core {
  fill: #c8d8df;
}

.fwlc-cut-line {
  stroke: #ef4444;
  stroke-linecap: round;
  stroke-width: 4;
  opacity: 0;
  transform-origin: 80px 80px;
  transition: opacity 180ms ease, transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fwlc-tooltip {
  position: absolute;
  z-index: 2;
  display: none;
  min-width: max-content;
  padding: 0.32rem 0.46rem;
  border: 1px solid rgba(31, 57, 83, 0.16);
  border-radius: 6px;
  background: #fff;
  color: #172033;
  box-shadow: 0 10px 24px rgba(24, 42, 58, 0.16);
  font-size: 0.72rem;
  pointer-events: none;
}

.fwlc-tooltip[data-visible="true"] {
  display: block;
}

.fwlc-ruler {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  overflow: hidden;
  height: 24px;
  border: 1px solid rgba(31, 57, 83, 0.14);
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(31, 57, 83, 0.28) 0 1px, transparent 1px 10%),
    #fff;
}

.fwlc-ruler i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(22, 196, 184, 0.24), rgba(22, 196, 184, 0.58));
  transition: width 420ms cubic-bezier(0.2, 0.8, 0.2, 1), background 180ms ease;
}

.fwlc-ruler b {
  position: relative;
  width: 1px;
  height: 12px;
  justify-self: end;
  background: rgba(31, 57, 83, 0.38);
}

.fwlc-cut-caption {
  visibility: hidden;
  color: #c93443;
}

.fwlc-stock {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  border-top: 1px solid rgba(31, 57, 83, 0.12);
  border-bottom: 1px solid rgba(31, 57, 83, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.fwlc-stock b {
  color: #a46d00;
}

.fwlc-readout[data-stock-state="enough"] .fwlc-stock b {
  color: #0c8f78;
}

.fwlc-readout[data-stock-state="short"] .fwlc-stock b {
  color: #c93443;
}

.fwlc-readout[data-stock-state="short"] .fwlc-ruler i {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.26), rgba(239, 68, 68, 0.68));
}

.fwlc-stock span {
  color: #34475a;
  font-size: 0.9rem;
}

.fwlc-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fwlc-kpis div {
  padding: 1rem 1.2rem;
  border-right: 1px solid rgba(31, 57, 83, 0.12);
}

.fwlc-kpis div:last-child {
  border-right: 0;
}

.fwlc-kpis b {
  display: block;
  margin-top: 0.3rem;
  color: #172033;
  font-size: 1.05rem;
}

.fwlc-formula {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(31, 57, 83, 0.12);
}

.fwlc-formula code {
  display: block;
  margin-top: 0.35rem;
  color: #168f87;
  white-space: normal;
}

.theme-dark .fwlc-root {
  border-color: rgba(118, 255, 224, 0.2);
  background: #0d1318;
  color: #e9f7f5;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

.theme-dark .fwlc-panel {
  background: linear-gradient(180deg, #101923, #0d1318);
  border-right-color: rgba(118, 255, 224, 0.16);
}

.theme-dark .fwlc-topbar {
  color: #96f0df;
}

.theme-dark .fwlc-segment {
  border-color: rgba(118, 255, 224, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.theme-dark .fwlc-segment button {
  color: #9bb1b6;
}

.theme-dark .fwlc-segment button[aria-pressed="true"] {
  background: #55f0d0;
  color: #071112;
}

.theme-dark .fwlc-field {
  color: #a8bbc0;
}

.theme-dark .fwlc-field input,
.theme-dark .fwlc-field select,
.theme-dark .fwlc-input {
  border-color: rgba(157, 177, 184, 0.22);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fffe;
}

.theme-dark .fwlc-field select option {
  background: #101923;
  color: #f8fffe;
}

.theme-dark .fwlc-input b,
.theme-dark .fwlc-hero em,
.theme-dark .fwlc-formula code {
  color: #55f0d0;
}

.theme-dark .fwlc-slider {
  accent-color: #55f0d0;
}

.theme-dark .fwlc-readout {
  background:
    linear-gradient(rgba(118, 255, 224, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 255, 224, 0.05) 1px, transparent 1px),
    #10151a;
  background-size: 26px 26px;
}

.theme-dark .fwlc-hero span,
.theme-dark .fwlc-kpis span,
.theme-dark .fwlc-formula span {
  color: #94aab0;
}

.theme-dark .fwlc-hero strong,
.theme-dark .fwlc-kpis b {
  color: #f8fffe;
}

.theme-dark .fwlc-spool-card > span,
.theme-dark .fwlc-ruler + small {
  color: #94aab0;
}

.theme-dark .fwlc-spool {
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.26));
}

.theme-dark .fwlc-spool-shell {
  fill: #1a2732;
  stroke: rgba(157, 177, 184, 0.2);
}

.theme-dark .fwlc-spool-empty {
  stroke: rgba(255, 255, 255, 0.08);
}

.theme-dark .fwlc-spool-hub {
  fill: #10151a;
  stroke: rgba(157, 177, 184, 0.22);
}

.theme-dark .fwlc-spool-core {
  fill: #263541;
}

.theme-dark .fwlc-tooltip {
  border-color: rgba(118, 255, 224, 0.2);
  background: #101923;
  color: #f8fffe;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
}

.theme-dark .fwlc-ruler {
  border-color: rgba(157, 177, 184, 0.16);
  background:
    repeating-linear-gradient(90deg, rgba(157, 177, 184, 0.3) 0 1px, transparent 1px 10%),
    rgba(255, 255, 255, 0.04);
}

.theme-dark .fwlc-ruler b {
  background: rgba(157, 177, 184, 0.42);
}

.theme-dark .fwlc-stock {
  border-color: rgba(157, 177, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.theme-dark .fwlc-stock b {
  color: #f0c36a;
}

.theme-dark .fwlc-readout[data-stock-state="enough"] .fwlc-stock b {
  color: #55f0d0;
}

.theme-dark .fwlc-readout[data-stock-state="short"] .fwlc-stock b {
  color: #ff6b6b;
}

.theme-dark .fwlc-stock span {
  color: #dce8ea;
}

.theme-dark .fwlc-kpis div {
  border-right-color: rgba(157, 177, 184, 0.14);
}

.theme-dark .fwlc-formula {
  border-top-color: rgba(157, 177, 184, 0.14);
}

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

  .fwlc-panel {
    border-right: 0;
    border-bottom: 1px solid rgba(31, 57, 83, 0.12);
  }

  .theme-dark .fwlc-panel {
    border-bottom-color: rgba(118, 255, 224, 0.16);
  }
}

@media (max-width: 560px) {
  .fwlc-topbar,
  .fwlc-stock {
    align-items: stretch;
    flex-direction: column;
  }

  .fwlc-stage {
    grid-template-columns: 1fr;
  }

  .fwlc-spool-card {
    padding: 0 1.2rem 1rem;
  }

  .fwlc-spool-wrap {
    width: min(76vw, 210px);
  }

  .fwlc-segment {
    width: 100%;
  }

  .fwlc-grid,
  .fwlc-kpis {
    grid-template-columns: 1fr;
  }

  .fwlc-kpis div {
    border-right: 0;
    border-bottom: 1px solid rgba(31, 57, 83, 0.12);
  }

  .theme-dark .fwlc-kpis div {
    border-bottom-color: rgba(157, 177, 184, 0.14);
  }
}
