.fptx-app {
  --fptx-ink: #18222d;
  --fptx-muted: #66717c;
  --fptx-accent: #1670a8;
  --fptx-border: #dce3e8;
  --fptx-surface: #f7f9fb;
  max-width: 1120px;
  margin: 40px auto;
  color: var(--fptx-ink);
  font-family: inherit;
}

.fptx-header { margin-bottom: 24px; }
.fptx-header h2 { margin: 2px 0 8px; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.1; }
.fptx-header p { max-width: 760px; margin: 0; color: var(--fptx-muted); font-size: 1.05rem; }
.fptx-header .fptx-kicker { color: var(--fptx-accent); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.fptx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.fptx-panel { padding: 22px; border: 1px solid var(--fptx-border); border-radius: 12px; background: #fff; box-shadow: 0 8px 30px rgba(24, 34, 45, .06); }
.fptx-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.fptx-label-row label { font-weight: 700; }
.fptx-label-row span { color: var(--fptx-muted); font-size: .78rem; }

.fptx-app textarea,
.fptx-app select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bdc9d2;
  border-radius: 7px;
  background: #fff;
  color: var(--fptx-ink);
  font: inherit;
}
.fptx-app textarea { min-height: 340px; padding: 15px; line-height: 1.55; resize: vertical; }
.fptx-app [data-fptx="output"] { background: var(--fptx-surface); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .84rem; }
.fptx-app select { min-width: 150px; padding: 10px 34px 10px 11px; }
.fptx-app textarea:focus,
.fptx-app select:focus { outline: 3px solid rgba(22, 112, 168, .16); border-color: var(--fptx-accent); }

.fptx-controls { display: grid; grid-template-columns: auto minmax(140px, 1fr); align-items: center; gap: 10px; margin-top: 14px; }
.fptx-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.fptx-app button { min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 7px; font: inherit; font-weight: 700; cursor: pointer; transition: transform .15s ease, opacity .15s ease, background .15s ease; }
.fptx-app button:hover:not(:disabled) { transform: translateY(-1px); }
.fptx-app button:disabled { opacity: .45; cursor: not-allowed; }
.fptx-app .fptx-primary { background: var(--fptx-accent); color: #fff; }
.fptx-app .fptx-secondary { border-color: var(--fptx-border) !important; background: #fff; color: var(--fptx-ink); }

.fptx-note { margin-top: 18px; padding: 13px 16px; border-left: 4px solid var(--fptx-accent); background: #edf6fb; font-size: .9rem; }
.fptx-details { margin-top: 12px; color: var(--fptx-muted); font-size: .88rem; }
.fptx-details summary { color: var(--fptx-ink); cursor: pointer; font-weight: 700; }
.fptx-panel { min-width: 0; }
.fptx-app .fptx-help { color: var(--fptx-muted); font-size: .85rem; line-height: 1.5; margin: 12px 0; }
.fptx-app .fptx-checkbox { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; font-size: .88rem; line-height: 1.5; }
.fptx-app .fptx-checkbox input { width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; }
.fptx-app button:focus-visible, .fptx-app summary:focus-visible { outline: 3px solid var(--fptx-accent); outline-offset: 3px; }
.fptx-app [aria-invalid="true"] { border-color: #a32323; }
@media (prefers-reduced-motion: reduce) { .fptx-app button { transition: none; transform: none !important; } }

@media (max-width: 820px) {
  .fptx-grid { grid-template-columns: 1fr; }
  .fptx-controls { grid-template-columns: 1fr 1fr; }
  .fptx-controls label { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .fptx-panel { padding: 16px; }
  .fptx-controls { grid-template-columns: 1fr; }
  .fptx-actions { flex-direction: column; }
  .fptx-app button { width: 100%; }
}
