:root {
  --n-ink: #2b1d27;
  --n-muted: #846c78;
  --n-paper: #fffaf4;
  --n-cream: #f5e9dc;
  --n-rose: #d86f63;
  --n-coral: #ef9c74;
  --n-amber: #f1c86b;
  --n-moss: #6d8f7c;
  --n-line: #ead8cf;
  --n-contrast: #fffaf4;
  --n-observatory: #2b1d27;
  --n-night: #5a3646;
  --n-soft: #f7d9bf;
  --n-axis: #d7b3aa;
  --n-alert: #ffb2a7;
  --n-glass: rgba(255, 250, 244, 0.08);
  --n-glass-border: rgba(255, 250, 244, 0.22);
  --n-shadow: rgba(78, 40, 49, 0.14);
}

.ffc-tool {
  color: var(--n-ink);
}

.ffc-shell {
  overflow: hidden;
  border: 1px solid var(--n-line);
  border-radius: 28px;
  background: var(--n-paper);
  box-shadow: 0 26px 70px var(--n-shadow);
}

.ffc-unit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.2rem;
  border-bottom: 1px solid var(--n-line);
  color: var(--n-muted);
  font-size: 0.72rem;
}

.ffc-unit-bar strong {
  color: var(--n-ink);
}

.ffc-unit-bar button {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--n-rose);
  border-radius: 999px;
  color: var(--n-rose);
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
}

.ffc-unit-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--n-moss);
}

.ffc-mode-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--n-line);
  background: var(--n-cream);
}

.ffc-mode {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 1rem 1.2rem;
  border: 0;
  border-right: 1px solid var(--n-line);
  color: var(--n-muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.ffc-mode:last-child {
  border-right: 0;
}

.ffc-mode[aria-pressed='true'] {
  color: var(--n-ink);
  background: var(--n-paper);
}

.ffc-mode strong,
.ffc-mode small {
  display: block;
}

.ffc-mode small {
  margin-top: 0.2rem;
  font-size: 0.76rem;
  color: var(--n-muted);
}

.ffc-mode-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  color: var(--n-contrast);
  background: var(--n-rose);
  font-size: 0.8rem;
}

.ffc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 2rem;
  padding: 2rem;
}

.ffc-controls {
  display: grid;
  gap: 1.1rem;
  align-content: start;
}

.ffc-section-heading {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.4rem;
  font-size: 1.05rem;
}

.ffc-section-heading span {
  color: var(--n-rose);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.ffc-control-group {
  display: grid;
  gap: 0.45rem;
}

.ffc-control-group label,
.ffc-label-line {
  font-size: 0.88rem;
  font-weight: 700;
}

.ffc-label-line {
  display: flex;
  gap: 0.35rem;
  align-items: baseline;
}

.ffc-label-line output {
  margin-left: auto;
  color: var(--n-rose);
  font-size: 1.2rem;
}

.ffc-control-group p {
  margin: 0;
  color: var(--n-muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.ffc-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ffc-chip-grid button,
.ffc-preset-row button {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--n-line);
  border-radius: 999px;
  color: var(--n-muted);
  background: var(--n-paper);
  cursor: pointer;
  font-size: 0.78rem;
}

.ffc-chip-grid button[aria-pressed='true'] {
  border-color: var(--n-rose);
  color: var(--n-contrast);
  background: var(--n-rose);
}

.ffc-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ffc-preset-row button {
  padding: 0.3rem 0.55rem;
  font-size: 0.7rem;
}

.ffc-preset-row button[aria-pressed='true'] {
  border-color: var(--n-rose);
  color: var(--n-ink);
  background: var(--n-cream);
  box-shadow: inset 0 -2px 0 var(--n-rose);
}

.ffc-two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.ffc-number-wrap {
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--n-line);
}

.ffc-number-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--n-ink);
  background: transparent;
  font-size: 1.35rem;
}

.ffc-number-wrap span {
  color: var(--n-muted);
  font-size: 0.78rem;
}

input[type='range'] {
  width: 100%;
  accent-color: var(--n-rose);
}

.ffc-reset {
  justify-self: start;
  margin-top: 0.3rem;
  padding: 0;
  border: 0;
  color: var(--n-muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.76rem;
  text-decoration: underline;
}

.ffc-observatory {
  position: relative;
  min-height: 500px;
  padding: 1.3rem;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(150deg, var(--n-observatory), var(--n-night));
  color: var(--n-contrast);
}

.ffc-observatory::before {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image: radial-gradient(var(--n-amber) 1px, transparent 1px);
  background-size: 18px 18px;
  content: '';
}

.ffc-observatory-top,
.ffc-result-card,
.ffc-status,
.ffc-assumptions {
  position: relative;
  z-index: 1;
}

.ffc-observatory-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.ffc-eyebrow {
  color: var(--n-amber);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
}

.ffc-scene-label {
  color: var(--n-soft);
  font-size: 0.75rem;
}

.ffc-vessel-stage {
  position: relative;
  height: 250px;
  margin: 1rem auto 0;
  max-width: 260px;
}

.ffc-vessel-glow {
  position: absolute;
  inset: 28% 16% 10%;
  border-radius: 50%;
  background: var(--n-coral);
  filter: blur(32px);
  opacity: 0.35;
}

.ffc-vessel {
  position: absolute;
  bottom: 8%;
  left: 29%;
  width: 42%;
  height: 68%;
  overflow: hidden;
  border: 2px solid var(--n-soft);
  border-top: 0;
  border-radius: 0 0 42% 42% / 0 0 18% 18%;
  background: var(--n-glass);
}

.ffc-vessel::before {
  position: absolute;
  top: -12%;
  left: -8%;
  width: 116%;
  height: 22%;
  border: 2px solid var(--n-soft);
  border-radius: 50%;
  content: '';
}

.ffc-vessel-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 24%;
  background: linear-gradient(180deg, var(--n-amber), var(--n-coral));
  transition: height 260ms ease;
}

.ffc-bubble {
  position: absolute;
  z-index: 2;
  width: 0.45rem;
  height: 0.45rem;
  border: 1px solid var(--n-contrast);
  border-radius: 50%;
  animation: ffc-float 3s infinite ease-in-out;
}

.bubble-one {
  bottom: 36%;
  left: 42%;
}

.bubble-two {
  bottom: 52%;
  left: 62%;
  animation-delay: 0.8s;
}

.bubble-three {
  bottom: 27%;
  left: 27%;
  animation-delay: 1.5s;
}

.ffc-target-marker {
  position: absolute;
  right: 4%;
  bottom: 36%;
  left: 8%;
  border-top: 1px dashed var(--n-amber);
  transition: bottom 260ms ease;
}

.ffc-target-marker span {
  position: absolute;
  top: -0.8rem;
  right: 0;
  padding-left: 0.3rem;
  color: var(--n-amber);
  font-size: 0.65rem;
}

.ffc-axis {
  position: absolute;
  right: 0;
  bottom: 9%;
  left: 0;
  display: flex;
  justify-content: space-between;
  color: var(--n-axis);
  font-size: 0.65rem;
}

.ffc-result-card {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--n-glass-border);
  border-radius: 16px;
  background: var(--n-glass);
}

.ffc-result-label {
  color: var(--n-soft);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ffc-result-card strong {
  color: var(--n-amber);
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 400;
}

.ffc-result-rate {
  color: var(--n-soft);
  font-size: 0.76rem;
}

.ffc-status {
  margin-top: 0.75rem;
  color: var(--n-contrast);
  font-size: 0.78rem;
}

.ffc-status[data-tone='watch'] {
  color: var(--n-amber);
}

.ffc-status[data-tone='caution'],
.ffc-status[data-tone='invalid'] {
  color: var(--n-alert);
}

.ffc-assumptions {
  margin-top: 1rem;
  color: var(--n-soft);
  font-size: 0.72rem;
}

.ffc-assumptions summary {
  cursor: pointer;
}

.ffc-assumptions p {
  max-width: 42ch;
  line-height: 1.5;
}

@keyframes ffc-float {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-18px);
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .ffc-mode-bar,
  .ffc-layout {
    grid-template-columns: 1fr;
  }

  .ffc-mode {
    border-right: 0;
    border-bottom: 1px solid var(--n-line);
  }

  .ffc-mode:last-child {
    border-bottom: 0;
  }

  .ffc-layout {
    padding: 1rem;
  }

  .ffc-two-up {
    grid-template-columns: 1fr;
  }
}

html.theme-light .ffc-tool {
  --n-ink: #2b1d27;
  --n-muted: #846c78;
  --n-paper: #fffaf4;
  --n-cream: #f5e9dc;
  --n-line: #ead8cf;
  --n-rose: #d86f63;
  --n-coral: #ef9c74;
  --n-amber: #f1c86b;
  --n-night: #5a3646;
  --n-observatory: #2b1d27;
  --n-contrast: #fffaf4;
  --n-soft: #f7d9bf;
  --n-axis: #d7b3aa;
  --n-alert: #ffb2a7;
  --n-shadow: rgba(78, 40, 49, 0.14);
}

html.theme-dark .ffc-tool {
  --n-ink: #fff7ef;
  --n-muted: #cbb5b3;
  --n-paper: #2b1d27;
  --n-cream: #422b37;
  --n-line: #624552;
  --n-rose: #e18476;
  --n-coral: #d97763;
  --n-amber: #f1c86b;
  --n-night: #30202b;
  --n-observatory: #171018;
  --n-contrast: #fff7ef;
  --n-soft: #f4cdb6;
  --n-axis: #c09aa2;
  --n-alert: #ffb2a7;
  --n-shadow: rgba(0, 0, 0, 0.25);
}

html.theme-dark .ffc-number-wrap input {
  color: var(--n-ink);
}

