/* 12-finishes (prefix: tfin) */
.tfin-root {
  margin: 0;
  padding: clamp(1.2rem, 2.5vw, 2rem) 0;
  background: var(--tcr-warm, #FAF7F2);
  color: var(--tcr-navy, #212326);
  font-family: var(--tcr-font-sans, 'Inter', system-ui, sans-serif);
  max-width: 100%;
  overflow-x: clip;
}

.tfin-shell {
  max-width: var(--tcr-max, 1280px);
  margin: 0 auto;
  padding: clamp(1rem, 2.4vw, 1.75rem);
  background: #ffffff;
  border: 1px solid var(--tcr-line-strong, #c8ccd2);
  border-radius: var(--tcr-radius-lg, 20px);
  box-shadow: var(--tcr-shadow, 0 12px 32px -12px rgba(14, 122, 142, 0.14));
}

.tfin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.15rem;
}

.tfin-head-copy {
  min-width: 0;
}

.tfin-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tcr-teal-ink, #0a6575);
}

.tfin-title {
  margin: 0;
  font-family: var(--tcr-font-display, 'Quicksand', system-ui, sans-serif);
  font-size: clamp(1.25rem, 2.3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--tcr-navy, #212326);
}

.tfin-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.tfin-readout {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--tcr-teal-soft, #e6f4f7);
  border: 1px solid rgba(10, 101, 117, 0.24);
  color: var(--tcr-teal-ink, #0a6575);
  font-size: 0.78rem;
  font-weight: 700;
}

.tfin-motion-slot {
  display: inline-flex;
  align-items: center;
}

.tfin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

@media (min-width: 960px) {
  .tfin-grid {
    grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.92fr);
    gap: 1.45rem;
  }
}

.tfin-stage-col {
  min-width: 0;
}

.tfin-stage {
  border-radius: var(--tcr-radius, 14px);
  overflow: hidden;
  border: 1.5px solid #163944;
  background: #0d1e24;
  box-shadow: 0 14px 32px -16px rgba(10, 31, 36, 0.5);
}

.tfin-svg {
  display: block;
  width: 100%;
  height: auto;
}

.tfin-caption {
  margin: 0.6rem 0 0;
  padding: 0 0.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--tcr-text, #434549);
  line-height: 1.45;
}

/* Controls panel */
.tfin-controls {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.tfin-block {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.tfin-block-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tcr-muted, #52555a);
}

.tfin-levels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.tfin-level-item {
  min-width: 0;
}

.tfin-level-item:last-child {
  grid-column: 1 / -1;
}

@media (min-width: 680px) and (max-width: 959px) {
  .tfin-levels {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .tfin-level-item:last-child {
    grid-column: auto;
  }
}

.tfin-level-btn {
  width: 100%;
  min-height: 46px;
  padding: 0.44rem 0.62rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.08rem;
  border-radius: 10px;
  border: 1.5px solid var(--tcr-line-strong, #c8ccd2);
  background: var(--tcr-warm, #FAF7F2);
  color: var(--tcr-navy, #212326);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.tfin-level-btn:hover {
  border-color: var(--tcr-teal, #0e7a8e);
  background: #f2fafc;
}

.tfin-level-btn.tfin-is-active {
  background: var(--tcr-teal, #0e7a8e);
  border-color: var(--tcr-teal-d, #0b6b7c);
  color: #ffffff;
}

.tfin-lvl-num {
  font-family: var(--tcr-font-display, 'Quicksand', sans-serif);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.15;
}

.tfin-lvl-tag {
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--tcr-text, #434549);
}

.tfin-level-btn.tfin-is-active .tfin-lvl-tag {
  color: #e6f4f7;
}

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

.tfin-swatch {
  width: 100%;
  min-height: 46px;
  padding: 0.38rem 0.56rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 10px;
  border: 1.5px solid var(--tcr-line, #e0e1e4);
  background: #ffffff;
  color: var(--tcr-navy, #212326);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.tfin-swatch:hover {
  border-color: var(--tcr-teal, #0e7a8e);
  background: #f6fbfc;
}

.tfin-swatch.tfin-is-active {
  border-color: var(--tcr-teal, #0e7a8e);
  background: var(--tcr-teal-soft, #e6f4f7);
  box-shadow: inset 3.5px 0 0 0 var(--tcr-teal, #0e7a8e);
}

.tfin-chip-sample {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(33, 35, 38, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.tfin-chip-meta {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.tfin-chip-name {
  font-family: var(--tcr-font-display, 'Quicksand', sans-serif);
  font-weight: 700;
  font-size: 0.83rem;
  line-height: 1.18;
  color: var(--tcr-navy, #212326);
}

.tfin-chip-sub {
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--tcr-text, #434549);
}

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

.tfin-counter-btn {
  width: 100%;
  min-height: 44px;
  padding: 0.42rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.52rem;
  border-radius: 10px;
  border: 1.5px solid var(--tcr-line, #e0e1e4);
  background: #ffffff;
  color: var(--tcr-navy, #212326);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.tfin-counter-btn:hover {
  border-color: var(--tcr-teal, #0e7a8e);
  background: #f6fbfc;
}

.tfin-counter-btn.tfin-is-active {
  border-color: var(--tcr-teal, #0e7a8e);
  background: var(--tcr-teal-soft, #e6f4f7);
}

.tfin-stone-dot {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(33, 35, 38, 0.28);
}

.tfin-counter-name {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--tcr-navy, #212326);
}

/* Arrival Choreography (resting state shows full lit finished cabinetry) */
.tfin-cab-layer {
  opacity: 1;
}

.tfin-root.tfin-arriving .tfin-cab-layer {
  animation: tfin-cab-reveal 1.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tfin-root.tfin-arriving .tfin-wire {
  stroke-dasharray: 110;
  animation: tfin-wire-draw 1.1s ease both;
}

.tfin-root.tfin-arriving .tfin-led-wash {
  animation: tfin-led-rise 1.9s ease both;
}

@keyframes tfin-wire-draw {
  from { stroke-dashoffset: 110; opacity: 1; }
  to { stroke-dashoffset: 0; opacity: 0.45; }
}

@keyframes tfin-cab-reveal {
  0% { opacity: 0.08; }
  45% { opacity: 0.24; }
  100% { opacity: 1; }
}

@keyframes tfin-led-rise {
  0% { opacity: 0; }
  55% { opacity: 0.15; }
  100% { opacity: 1; }
}

html.tcrm-paused .tfin-root *,
html.tcrm-paused .tfin-root *::before,
html.tcrm-paused .tfin-root *::after {
  animation-play-state: paused !important;
  transition-duration: 0.001ms !important;
}

@media (prefers-reduced-motion: reduce) {
  .tfin-root *,
  .tfin-root *::before,
  .tfin-root *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 480px) {
  .tfin-shell {
    padding: 0.85rem;
    border-radius: 14px;
  }
  .tfin-readout {
    font-size: 0.72rem;
    padding: 0.3rem 0.65rem;
  }
}
