/* ===========================================
   Filling Cascade – Punkfish Tool
   =========================================== */

.pf-tool-frame.fc-container {
  width: min(1120px, calc(100vw - 1.25rem));
  max-width: 1120px;
  overflow: hidden;
}

.fc-container,
.fc-container *,
.fc-container *::before,
.fc-container *::after {
  box-sizing: border-box;
}

.fc-container {
  --fc-purple: #3b22a3;
  --fc-purple-dark: #26136f;
  --fc-yellow: #ffea00;
  --fc-ink: #1e2633;
  --fc-muted: #647084;
  --fc-line: rgba(59, 34, 163, 0.16);
  --fc-soft: #f7f5ff;
  --fc-card: #ffffff;
  --fc-good: #057a55;
  --fc-warn: #a15c00;
  --fc-bad: #b42318;
  --fc-shadow: 0 14px 34px rgba(31, 24, 92, 0.10);

  color: var(--fc-ink);
  font-family: inherit;
}

.fc-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: clamp(1.1rem, 2vw, 1.7rem);
  background:
    radial-gradient(circle at top right, rgba(255, 234, 0, 0.42), transparent 35%),
    linear-gradient(135deg, #3b22a3 0%, #231067 100%);
  color: #fff;
  box-shadow: var(--fc-shadow);
}

.fc-kicker {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 0.65rem;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  background: var(--fc-yellow);
  color: #221253;
  font-weight: 850;
  font-size: 0.82rem;
}

.fc-hero h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.65rem, 2.8vw, 2.35rem);
  line-height: 1.08;
}

.fc-hero p {
  max-width: 820px;
  margin: 0;
  line-height: 1.52;
  color: rgba(255,255,255,0.9);
}

.fc-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.9rem 0;
}

.fc-stat {
  min-width: 0;
  border: 1px solid var(--fc-line);
  border-radius: 16px;
  background: #fff;
  padding: 0.8rem;
  box-shadow: 0 8px 22px rgba(31,24,92,0.06);
}

.fc-stat span {
  display: block;
  color: var(--fc-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.fc-stat strong {
  display: block;
  margin-top: 0.15rem;
  color: var(--fc-purple-dark);
  font-size: 1.05rem;
}

.fc-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 0.9rem;
  align-items: start;
}

.fc-panel {
  min-width: 0;
  border: 1px solid var(--fc-line);
  border-radius: 20px;
  background: var(--fc-card);
  box-shadow: var(--fc-shadow);
  overflow: hidden;
}

.fc-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.95rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(59, 34, 163, 0.10);
  background: linear-gradient(180deg, rgba(247, 245, 255, 0.95), rgba(255,255,255,0.95));
}

.fc-panel-head h2 {
  margin: 0 0 0.18rem;
  font-size: 1.03rem;
  color: var(--fc-purple-dark);
}

.fc-panel-head p {
  margin: 0;
  color: var(--fc-muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.fc-bank-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 0.7rem;
  padding: 0.85rem;
}

.fc-storage-card,
.fc-receiver-card {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(59, 34, 163, 0.18);
  border-radius: 17px;
  background: #fff;
  padding: 0.68rem 0.62rem;
  text-align: center;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.fc-storage-card.is-open {
  border-color: rgba(5,122,85,0.56);
  box-shadow: 0 10px 22px rgba(5,122,85,0.12);
  transform: translateY(-2px);
}

.fc-storage-card.is-compressor-target {
  outline: 2px solid rgba(255,234,0,0.8);
  outline-offset: 2px;
}

.fc-name {
  margin: 0 0 0.44rem;
  font-weight: 850;
  color: var(--fc-purple-dark);
  font-size: 0.86rem;
}

.fc-cylinder-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 122px;
  margin-bottom: 0.46rem;
}

.fc-cylinder {
  position: relative;
  width: 40px;
  height: 112px;
  border: 2px solid rgba(35, 16, 103, 0.38);
  border-radius: 20px 20px 12px 12px;
  overflow: hidden;
  background: linear-gradient(90deg, #d9deea 0%, #ffffff 42%, #b9c3d5 100%);
  box-shadow: inset -9px 0 16px rgba(35,16,103,0.12);
}

.fc-receiver-card .fc-cylinder {
  width: 34px;
  height: 88px;
}

.fc-cylinder::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -2px;
  width: 24px;
  height: 11px;
  border-radius: 0 0 7px 7px;
  transform: translateX(-50%);
  background: #372084;
  z-index: 3;
}

.fc-cylinder-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--fill, 0%);
  background: linear-gradient(180deg, rgba(255,234,0,0.96), rgba(59,34,163,0.88));
  transition: height 120ms linear;
}

.fc-cylinder-label {
  position: absolute;
  left: 50%;
  bottom: 0.42rem;
  transform: translateX(-50%);
  z-index: 2;
  color: #fff;
  font-weight: 850;
  font-size: 0.75rem;
  text-shadow: 0 1px 5px rgba(0,0,0,0.45);
  white-space: nowrap;
}

.fc-pressure {
  display: block;
  margin: 0.2rem 0 0.42rem;
  font-weight: 900;
  font-size: 0.98rem;
  color: var(--fc-ink);
}

.fc-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.42rem;
  margin-bottom: 0.45rem;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  background: #eef0f7;
  color: var(--fc-muted);
  font-size: 0.73rem;
  font-weight: 800;
}

.fc-storage-card.is-open .fc-state {
  background: rgba(5,122,85,0.12);
  color: var(--fc-good);
}

.fc-button,
.fc-valve-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 850;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.fc-button:disabled,
.fc-valve-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.fc-button:active,
.fc-valve-button:active {
  transform: translateY(1px);
}

.fc-valve-button {
  width: 100%;
  padding: 0.52rem 0.62rem;
  background: var(--fc-purple);
  color: #fff;
  box-shadow: 0 8px 15px rgba(59,34,163,0.18);
  font-size: 0.82rem;
}

.fc-compressor-check {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  color: var(--fc-muted);
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
}

.fc-manifold {
  margin: 0 0.85rem 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(59,34,163,0.14);
  background: var(--fc-soft);
  padding: 0.8rem;
}

.fc-pipe {
  position: relative;
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(59,34,163,0.16);
  margin-bottom: 0.65rem;
}

.fc-pipe::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,234,0,0.95), transparent);
}

.fc-pipe.is-flowing::after {
  animation: fc-flow 900ms linear infinite;
}

@keyframes fc-flow {
  to { transform: translateX(100%); }
}

.fc-manifold-info {
  display: grid;
  gap: 0.22rem;
  color: var(--fc-muted);
  font-size: 0.84rem;
}

.fc-manifold-info strong {
  color: var(--fc-purple-dark);
  font-size: 0.92rem;
}

.fc-receiver-wrap {
  padding: 0.85rem;
}

.fc-big-pressure {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
  margin: 0.1rem 0 0.55rem;
  color: var(--fc-purple-dark);
}

.fc-big-pressure strong {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.fc-progress-shell {
  height: 15px;
  border-radius: 999px;
  background: #e8eaf4;
  overflow: hidden;
  margin-bottom: 0.7rem;
}

.fc-progress-bar {
  height: 100%;
  width: var(--target-fill, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--fc-purple), var(--fc-yellow));
  transition: width 120ms linear;
}

.fc-receivers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.fc-side-content {
  padding: 0.85rem;
}

.fc-status-card {
  border: 1px solid rgba(59,34,163,0.14);
  border-radius: 16px;
  padding: 0.8rem;
  background: var(--fc-soft);
  margin-bottom: 0.8rem;
}

.fc-status-card h3 {
  margin: 0 0 0.35rem;
  color: var(--fc-purple-dark);
  font-size: 0.96rem;
}

.fc-status-card p {
  margin: 0;
  color: var(--fc-muted);
  line-height: 1.45;
  font-size: 0.88rem;
}

.fc-controls {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.fc-button {
  width: 100%;
  padding: 0.68rem 0.85rem;
  background: var(--fc-purple);
  color: #fff;
  box-shadow: 0 8px 16px rgba(59,34,163,0.18);
}

.fc-button.secondary {
  background: #edf0f8;
  color: var(--fc-purple-dark);
  box-shadow: none;
}

.fc-button.warning {
  background: var(--fc-yellow);
  color: #21124e;
}

.fc-history {
  min-height: 4.2rem;
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.44rem;
}

.fc-history li {
  border: 1px solid rgba(59,34,163,0.12);
  border-radius: 12px;
  padding: 0.55rem;
  color: var(--fc-muted);
  font-size: 0.82rem;
  line-height: 1.35;
  background: #fff;
}

.fc-output {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.fc-output-card {
  border: 1px solid var(--fc-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--fc-shadow);
  overflow: hidden;
}

.fc-output-card > h2,
.fc-output-card > h3 {
  margin: 0;
  padding: 0.95rem 1rem 0.7rem;
  color: var(--fc-purple-dark);
  border-bottom: 1px solid rgba(59,34,163,0.10);
  background: linear-gradient(180deg, rgba(247,245,255,0.95), #fff);
}

.fc-output-inner {
  padding: 0.95rem 1rem 1rem;
}

.fc-output-inner p {
  margin: 0 0 0.7rem;
  line-height: 1.48;
  color: var(--fc-muted);
}

.fc-result-grid,
.fc-strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.65rem;
  margin: 0.8rem 0;
}

.fc-result-box,
.fc-strategy-box {
  border: 1px solid rgba(59,34,163,0.14);
  border-radius: 15px;
  padding: 0.75rem;
  background: var(--fc-soft);
}

.fc-result-box span,
.fc-strategy-box span {
  display: block;
  color: var(--fc-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.fc-result-box strong,
.fc-strategy-box strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--fc-purple-dark);
  font-size: 1.1rem;
}

.fc-note {
  border-left: 4px solid var(--fc-purple);
  background: var(--fc-soft);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  color: var(--fc-muted);
}

.fc-note.good { border-left-color: var(--fc-good); }
.fc-note.warn { border-left-color: var(--fc-warn); }
.fc-note.bad { border-left-color: var(--fc-bad); }

.fc-table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.fc-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.fc-table th,
.fc-table td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid rgba(59,34,163,0.12);
  vertical-align: top;
}

.fc-table th {
  color: var(--fc-purple-dark);
  background: var(--fc-soft);
}

.fc-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--fc-yellow);
  color: #21124e;
  font-size: 0.75rem;
  font-weight: 850;
}

.fc-loading,
.fc-error {
  padding: 1rem;
  border-radius: 16px;
  background: #fff;
  color: var(--fc-muted, #647084);
  border: 1px solid rgba(59,34,163,0.14);
}

@media (max-width: 980px) {
  .pf-tool-frame.fc-container {
    width: min(100%, calc(100vw - 0.75rem));
  }

  .fc-dashboard {
    grid-template-columns: 1fr;
  }

  .fc-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .fc-hero {
    border-radius: 18px;
  }

  .fc-status-strip,
  .fc-receivers {
    grid-template-columns: 1fr 1fr;
  }

  .fc-bank-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .fc-status-strip,
  .fc-bank-list,
  .fc-receivers {
    grid-template-columns: 1fr;
  }
}

/* V3: narrower, level-based layout */
.pf-tool-frame.fc-container {
  width: min(100%, calc(100vw - 1rem));
  max-width: 1000px;
  overflow-x: hidden;
}

.fc-level-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.85rem 0;
}

.fc-level-tab {
  min-width: 0;
  border: 1px solid rgba(59, 34, 163, 0.18);
  border-radius: 16px;
  background: #fff;
  color: var(--fc-ink);
  padding: 0.75rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(31,24,92,0.06);
}

.fc-level-tab span {
  display: inline-flex;
  margin-bottom: 0.18rem;
  color: var(--fc-muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.fc-level-tab strong {
  display: block;
  color: var(--fc-purple-dark);
  font-size: 0.94rem;
  line-height: 1.16;
}

.fc-level-tab.is-active {
  border-color: rgba(255,234,0,0.95);
  background: linear-gradient(135deg, rgba(255,234,0,0.22), rgba(247,245,255,0.96));
  box-shadow: 0 10px 22px rgba(59,34,163,0.12);
}

.fc-dashboard {
  grid-template-columns: 1fr;
}

.fc-controls {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.fc-table {
  min-width: 0;
}

.fc-badge.subtle {
  background: #edf0f8;
  color: var(--fc-purple-dark);
}

@media (max-width: 720px) {
  .fc-level-tabs {
    grid-template-columns: 1fr;
  }
}
/* Hero-Titel im Füllkaskaden-Tool erzwingen */
.pf-tool-frame.fc-container .fc-hero h1,
#fillingCascadeApp .fc-hero h1,
.fc-container .fc-hero h1 {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}