/* ---------- propagation strip ---------- */
.ff-pipe {
  padding: 16px;
  margin-bottom: 28px;
}

.ff-pipe__nodes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

.ff-pipe__nodes li {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 10px 12px 10px 0;
  border-top: var(--bw-thick) solid var(--panel-2);
  transition: border-color 0.12s linear;
}

.ff-pipe__nodes li::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 0;
  width: 14px;
  height: 14px;
  border: var(--bw) solid var(--ink);
  background: var(--panel);
}

.ff-pipe__nodes b {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-top: 8px;
}

.ff-pipe__nodes span {
  font-size: 0.8rem;
  color: var(--ink-3);
}

.ff-pipe__nodes li.is-done {
  border-top-color: var(--ink);
}

.ff-pipe__nodes li.is-done::before {
  background: var(--ink);
}

.ff-pipe__nodes li.is-active {
  border-top-color: var(--accent);
}

.ff-pipe__nodes li.is-active::before {
  background: var(--accent);
  border-color: var(--accent);
}

.ff-pipe__log {
  margin-top: 10px;
  min-height: 1.4em;
}

/* ---------- layout ---------- */
.ff-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.ff-store-wrap {
  display: grid;
  gap: 28px;
  min-width: 0;
}

/* ---------- dashboard ---------- */
.ff-table {
  width: 100%;
  border-collapse: collapse;
}

.ff-table th,
.ff-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--panel-2);
  text-align: left;
}

.ff-table thead th {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.ff-table .ff-env {
  text-align: center;
  width: 72px;
  white-space: nowrap;
}

.ff-lock {
  width: 0.85em;
  height: 0.85em;
  vertical-align: -1px;
}

.ff-table tr.is-selected th,
.ff-table tr.is-selected td {
  background: var(--panel-2);
}

.ff-flagname {
  display: grid;
  text-align: left;
  gap: 1px;
}

.ff-flagname b {
  font-weight: 500;
}

.ff-flagname span {
  font-size: 0.72rem;
  color: var(--ink-3);
}

.ff-flagname:hover b {
  color: var(--accent);
}

/* lamp switch */
.ff-switch {
  position: relative;
  width: 40px;
  height: 22px;
  border: var(--bw) solid var(--ink);
  background: var(--panel);
  flex: none;
  transition: background-color var(--t);
}

.ff-switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--ink-3);
  transition: transform var(--t), background-color var(--t);
}

.ff-switch[aria-checked='true'] {
  background: var(--ink);
}

.ff-switch[aria-checked='true'] i {
  transform: translateX(18px);
  background: var(--accent);
}

/* detail */
.ff-detail {
  border-top: var(--bw) solid var(--ink);
  padding: 16px;
  display: grid;
  gap: 16px;
}

.ff-detail__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ff-detail__title {
  font-family: var(--display);
  font-size: 1.2rem;
  text-transform: uppercase;
}

.ff-type {
  align-self: start;
  border: var(--bw) solid var(--ink);
  padding: 2px 8px;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.ff-tabs {
  justify-self: start;
}

.ff-block {
  display: grid;
  gap: 8px;
}

.ff-onoff {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ff-list {
  display: grid;
  gap: 8px;
}

.ff-rule {
  border: var(--bw) solid var(--ink);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.ff-rule__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ff-x {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  text-decoration: underline;
}

.ff-x:hover {
  color: var(--accent);
}

.ff-cond {
  font-size: 0.92rem;
}

.ff-arrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.ff-serve {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.ff-select,
.ff-input {
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--panel);
  border: var(--bw) solid var(--ink);
  padding: 5px 8px;
  border-radius: 0;
}

.ff-input[type='number'] {
  width: 90px;
}

.ff-slider {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  align-items: center;
  gap: 10px;
  flex: 1 1 260px;
  font-size: 0.78rem;
}

.ff-weights {
  display: grid;
  gap: 6px;
  width: 100%;
}

.ff-weights label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.ff-error {
  color: var(--accent);
  font-size: 0.85rem;
}

.ff-save {
  border-top: var(--bw) dashed var(--ink-3);
  padding-top: 14px;
  display: grid;
  gap: 12px;
}

.ff-diff {
  display: grid;
  gap: 4px;
  font-size: 0.88rem;
  list-style: square inside;
}

.ff-save__btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- browser frame ---------- */
.ff-browser {
  border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow);
  background: var(--panel);
  min-width: 0;
}

.ff-browser__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: var(--bw) solid var(--ink);
}

.ff-dots {
  display: inline-flex;
  gap: 5px;
}

.ff-dots i {
  width: 9px;
  height: 9px;
  border: var(--bw) solid var(--ink);
}

.ff-url {
  font-size: 0.72rem;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ff-sdkenv {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ff-sdkenv select {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink);
  background: var(--panel);
  border: var(--bw) solid var(--ink);
  padding: 3px 6px;
}

/* ---------- the store, in Acme Coffee's own look ---------- */
.ff-store {
  --espresso: #3b2a20;
  --cream: #f7f3ee;
  --st-ink: #2b1e17;
  --st-muted: #6b5a4e;
  --acc: #5e7f4f;
  --rad: 14px;
  background: var(--cream);
  color: var(--st-ink);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.92rem;
  line-height: 1.45;
}

.st-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: var(--espresso);
  color: var(--cream);
}

.st-logo {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.st-persona {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 0.8rem;
  opacity: 0.9;
}

.st-persona select {
  font: inherit;
  color: var(--st-ink);
  background: var(--cream);
  border: 0;
  border-radius: 6px;
  padding: 3px 6px;
}

.st-cart {
  font-size: 0.8rem;
  padding: 3px 10px;
  border: 1px solid rgba(247, 243, 238, 0.4);
  border-radius: 999px;
}

.st-banner {
  padding: 10px 18px;
  background: var(--acc);
  color: #fff;
  font-weight: 600;
  text-align: center;
}

.st-main {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.st-title {
  font-size: 1.3rem;
  font-weight: 600;
}

.st-sub {
  color: var(--st-muted);
  margin-top: -8px;
}

.st-prods {
  display: grid;
  gap: 10px;
}

.st-prod {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border-radius: var(--rad);
  box-shadow: 0 1px 2px rgba(59, 42, 32, 0.12);
}

.st-art svg {
  width: 56px;
  height: 64px;
  display: block;
}

.st-prod__info {
  display: grid;
  min-width: 0;
}

.st-prod__info span {
  font-size: 0.8rem;
  color: var(--st-muted);
}

.st-notes {
  font-style: italic;
}

.st-prod__buy {
  display: grid;
  justify-items: end;
  gap: 6px;
  font-weight: 600;
}

.st-prods.is-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.st-prods.is-grid .st-prod {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  padding: 14px 10px;
}

.st-prods.is-grid .st-prod__buy {
  justify-items: center;
}

.st-prods.is-grid .st-notes {
  display: none;
}

.st-btn {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--rad);
  border: 0;
  cursor: pointer;
  color: #fff;
  background: var(--espresso);
  transition: filter 0.12s linear;
}

.st-btn:hover:not(:disabled) {
  filter: brightness(1.15);
}

.st-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.st-btn--line {
  background: transparent;
  color: var(--espresso);
  border: 1.5px solid var(--espresso);
}

.st-btn--secondary {
  background: var(--acc);
}

.st-btn--success {
  background: #2e7d32;
}

.st-cartbox {
  margin-top: 6px;
  padding: 12px 14px;
  background: #fff;
  border-radius: var(--rad);
  display: grid;
  gap: 8px;
}

.st-lines {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}

.st-lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 64px;
  gap: 10px;
  align-items: center;
}

.st-lines li > span:last-child {
  text-align: right;
}

.st-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.st-qty button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--espresso);
  color: var(--espresso);
  line-height: 1;
}

.st-qty button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.st-empty {
  color: var(--st-muted);
  font-size: 0.85rem;
}

.st-warn {
  color: #a0522d;
  font-size: 0.85rem;
  font-weight: 600;
}

.st-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

/* a short highlight on whatever a change touched */
@keyframes ff-flash {
  0% {
    box-shadow: 0 0 0 3px var(--accent);
  }

  100% {
    box-shadow: 0 0 0 3px transparent;
  }
}

.is-flash {
  animation: ff-flash 1.4s ease-out;
}

.ff-store.is-flash {
  animation: ff-flash 1.4s ease-out;
}

/* ---------- inspector ---------- */
.ff-itable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.ff-itable th,
.ff-itable td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--panel-2);
  text-align: left;
  vertical-align: top;
}

.ff-itable th {
  font-weight: 400;
  color: var(--ink-3);
}

.ff-itable td.mono {
  word-break: break-all;
}

.ff-itable tr.is-flash td,
.ff-itable tr.is-flash th {
  animation: ff-row 1.4s ease-out;
}

@keyframes ff-row {
  0% {
    background: var(--accent);
    color: var(--on-accent);
  }

  100% {
    background: transparent;
  }
}

/* ---------- audit ---------- */
.ff-audit {
  margin-top: 28px;
}

.ff-audit__list {
  padding: 12px 16px;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

.ff-audit__list li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
}

/* ---------- dialog ---------- */
.ff-dialog {
  margin: auto;
  padding: 0;
  max-width: 440px;
  width: calc(100% - 32px);
  color: var(--ink);
}

.ff-dialog::backdrop {
  background: rgba(11, 11, 11, 0.55);
}

.ff-dialog__body {
  display: grid;
  gap: 14px;
}

.ff-dialog__body label {
  display: grid;
  gap: 6px;
}

.ff-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1100px) {
  .ff-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .ff-pipe__nodes {
    grid-template-columns: 1fr;
  }

  .ff-pipe__nodes li {
    border-top: 0;
    border-left: var(--bw-thick) solid var(--panel-2);
    padding: 4px 0 8px 18px;
  }

  .ff-pipe__nodes li.is-done {
    border-left-color: var(--ink);
  }

  .ff-pipe__nodes li.is-active {
    border-left-color: var(--accent);
  }

  .ff-pipe__nodes li::before {
    top: 4px;
    left: -9px;
  }

  .ff-pipe__nodes b {
    margin-top: 0;
  }

  .st-prods.is-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ff-audit__list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-flash,
  .ff-store.is-flash,
  .ff-itable tr.is-flash td,
  .ff-itable tr.is-flash th {
    animation: none;
  }
}

.ff-audit__list li.small {
  display: block;
}

.ff-itable th {
  white-space: nowrap;
}
