/* ==========================================================================
   Paddy Prompt Studio — note frequency chart
   Layers on /blog/style.css and /tools/shared/tool-common.css.
   ========================================================================== */

.nf-display { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1rem; align-items: center; }
.nf-readout { text-align: center; }
.nf-big {
  margin: 0; font-family: "Space Grotesk", "Inter", sans-serif; font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 4rem); line-height: 1; color: #fff; letter-spacing: -0.02em;
}
.nf-hz { margin: 0.35rem 0 0; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.2rem; font-weight: 700; color: #a5f3fc; font-variant-numeric: tabular-nums; }
.nf-cents { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--text-muted); min-height: 1.4em; }
.nf-cents.sharp { color: #fcd34d; }
.nf-cents.flat { color: #93c5fd; }
.nf-cents.spot { color: #a7f3d0; }

.nf-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin: 0; }
.nf-stats > div { background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border-soft); border-radius: 12px; padding: 0.55rem 0.75rem; min-width: 0; }
.nf-stats dt { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.nf-stats dd { margin: 0.15rem 0 0; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.98rem; color: #fff; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.nf-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.8rem; margin-top: 1rem; }
.nf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.nf-freq, .nf-a4 { width: 8.5rem; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1rem; }
.nf-select { min-width: 4.6rem; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1rem; cursor: pointer; }
.nf-select option { background: #12131c; color: var(--text); }
.nf-select:focus-visible { outline: 2px solid #22d3ee; outline-offset: 1px; }
.nf-unit { color: var(--text-dim); font-weight: 700; }
.nf-mini { margin: 0.45rem 0 0; font-size: 0.78rem; color: var(--text-dim); }
.nf-presets { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }
.nf-presets .chip-btn[aria-pressed="true"] { background: rgba(34, 211, 238, 0.16); border-color: rgba(103, 232, 249, 0.6); color: #a5f3fc; }

.nf-play-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-top: 1.1rem; }
.nf-play { min-width: 12rem; min-height: 54px; font-size: 1.05rem; border-radius: 14px; }
.nf-play .ico { width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent currentColor; }

.nf-toolbar { display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem; align-items: flex-end; margin-top: 1rem; }
.nf-toolbar > div:last-child { flex: 1 1 10rem; min-width: 9rem; }

.nf-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 1rem 0 0.5rem; font-size: 0.78rem; color: var(--text-muted); }
.nf-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.sw { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 4px; border: 1px solid var(--border); }
.sw-c4 { background: rgba(34, 211, 238, 0.28); border-color: rgba(103, 232, 249, 0.8); }
.sw-a4 { background: rgba(251, 191, 36, 0.24); border-color: rgba(252, 211, 77, 0.8); }
.sw-open { background: transparent; border: 2px solid #f472b6; }
.sw-off { background: rgba(255, 255, 255, 0.02); opacity: 0.5; border-style: dashed; }

/* ------------------------------------------------------------ chart */
.nf-chart-wrap { margin: 0; background: rgba(0, 0, 0, 0.22); }
.nf-chart-wrap:focus-visible { outline: 2px solid #22d3ee; outline-offset: 2px; }
.nf-chart { width: 100%; min-width: 50rem; border-collapse: separate; border-spacing: 3px; table-layout: fixed; font-size: 0.8rem; }
.nf-chart caption { text-align: left; padding: 0.7rem 0.8rem 0.3rem; color: var(--text-dim); font-size: 0.8rem; }
.nf-chart th {
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.72rem; font-weight: 700;
  color: var(--indigo); text-align: center; padding: 0.35rem 0.1rem;
}
.nf-chart thead th { line-height: 1.15; }
.nf-chart .nf-alt { display: block; color: var(--text-dim); font-weight: 400; font-size: 0.66rem; }
.nf-chart .nf-oct-h { width: 3.6rem; font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; }
.nf-chart tbody th { position: sticky; left: 0; z-index: 1; background: #0e1018; border-radius: 8px; font-size: 0.85rem; }
.nf-chart td { padding: 0; }
.nf-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem;
  width: 100%; min-height: 3.3rem; padding: 0.35rem 0.1rem; cursor: pointer;
  font: inherit; color: var(--text); background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-soft); border-radius: 9px;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.nf-cell:hover { background: rgba(129, 140, 248, 0.18); border-color: rgba(129, 140, 248, 0.5); }
.nf-cell:focus-visible { outline: 2px solid #22d3ee; outline-offset: 1px; z-index: 2; }
.nf-cell .nf-n { font-weight: 700; font-size: 0.78rem; color: #fff; }
.nf-cell .nf-f { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.74rem; color: #a5f3fc; font-variant-numeric: tabular-nums; }
.nf-cell .nf-tag { font-size: 0.56rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); line-height: 1; }
.nf-cell.is-black { background: rgba(0, 0, 0, 0.35); }
.nf-cell.is-c4 { background: rgba(34, 211, 238, 0.18); border-color: rgba(103, 232, 249, 0.75); }
.nf-cell.is-a4 { background: rgba(251, 191, 36, 0.16); border-color: rgba(252, 211, 77, 0.75); }
.nf-cell.off-piano { opacity: 0.5; border-style: dashed; }
.nf-cell.is-open { box-shadow: inset 0 0 0 2px #f472b6; }
.nf-cell.is-sel { background: linear-gradient(135deg, rgba(129, 140, 248, 0.55), rgba(34, 211, 238, 0.45)); border-color: #fff; opacity: 1; }
.nf-cell.is-sel .nf-f { color: #fff; }
.nf-cell.ping { transform: scale(0.95); }

.nf-swipe { display: none; margin: 0.4rem 0 0; text-align: center; font-size: 0.75rem; color: var(--text-dim); }
.nf-export { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.9rem; }

@media (max-width: 900px) {
  .nf-swipe { display: block; }
}
@media (max-width: 640px) {
  .nf-display { grid-template-columns: 1fr; }
  .nf-play { width: 100%; }
  .nf-toolbar > div { width: 100%; }
  .nf-toolbar .seg { display: flex; }
  .nf-toolbar .seg button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .nf-cell, .nf-cell.ping { transition: none; transform: none; }
}
