.fsa-app {
  --fsa-text: #172033;
  --fsa-muted: #64748b;
  --fsa-line: #dce3eb;
  --fsa-soft: #f7f9fc;
  --fsa-main: #172033;
  --fsa-main-hover: #27344d;
  --fsa-accent: #2457d6;
  --fsa-accent-soft: #eef4ff;
  --fsa-ok-text: #166534;
  --fsa-ok-bg: #f0fdf4;
  --fsa-warn-text: #9a3412;
  --fsa-warn-bg: #fff7ed;
  --fsa-error-text: #991b1b;
  --fsa-error-bg: #fef2f2;
  --fsa-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  width: 100%;
  max-width: 1040px;
  margin: 40px auto;
  color: var(--fsa-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

.fsa-app,
.fsa-app * {
  box-sizing: border-box;
}

.fsa-box {
  padding: 34px;
  background: #fff;
  border: 1px solid var(--fsa-line);
  border-radius: 18px;
  box-shadow: var(--fsa-shadow);
}

.fsa-heading-area {
  margin-bottom: 24px;
}

.fsa-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--fsa-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

/*
 * WordPressテーマ（SWELLなど）の見出し装飾がツール内へ入り込まないよう、
 * タイトルを明示的にリセットします。
 */
.fsa-app .fsa-heading-area > .fsa-title {
  display: block !important;
  position: static !important;
  width: auto !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--fsa-text) !important;
  font-size: clamp(25px, 3vw, 32px) !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  letter-spacing: normal !important;
  text-align: left !important;
  text-shadow: none !important;
}

.fsa-app .fsa-heading-area > .fsa-title::before,
.fsa-app .fsa-heading-area > .fsa-title::after {
  display: none !important;
  content: none !important;
}

.fsa-lead {
  margin: 0;
  color: #475569;
  font-size: 15px;
  line-height: 1.85;
}

.fsa-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 24px;
  padding: 5px;
  background: #eef2f7;
  border-radius: 12px;
}

.fsa-tab {
  appearance: none;
  min-height: 46px;
  padding: 10px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.fsa-tab:hover {
  color: var(--fsa-text);
}

.fsa-tab.is-active {
  background: #fff;
  color: var(--fsa-text);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.fsa-mode-panel {
  padding: 24px;
  background: var(--fsa-soft);
  border: 1px solid var(--fsa-line);
  border-radius: 14px;
}

.fsa-field + .fsa-field {
  margin-top: 20px;
}

.fsa-field > label {
  display: block;
  margin-bottom: 8px;
  color: var(--fsa-text);
  font-size: 14px;
  font-weight: 750;
}

.fsa-required {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  vertical-align: 2px;
}

.fsa-input,
.fsa-textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: var(--fsa-text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fsa-input {
  min-height: 50px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
}

.fsa-textarea {
  min-height: 300px;
  padding: 15px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
}

.fsa-input:focus,
.fsa-textarea:focus {
  border-color: var(--fsa-accent);
  box-shadow: 0 0 0 3px rgba(36, 87, 214, 0.12);
}

.fsa-help {
  margin: 7px 0 0;
  color: var(--fsa-muted);
  font-size: 12px;
  line-height: 1.65;
}

.fsa-check {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin-top: 15px;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
}

.fsa-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--fsa-accent);
}

.fsa-primary-button {
  appearance: none;
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  padding: 14px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--fsa-main);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.fsa-primary-button:hover {
  background: var(--fsa-main-hover);
}

.fsa-primary-button:active {
  transform: translateY(1px);
}

.fsa-primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.fsa-privacy-note,
.fsa-limit-note {
  color: #596579;
  font-size: 12px;
  line-height: 1.75;
}

.fsa-privacy-note {
  margin-top: 14px;
}

.fsa-limit-note {
  margin-top: 24px;
  padding: 13px 15px;
  border-left: 3px solid #94a3b8;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
}

.fsa-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 14px;
  font-weight: 700;
}

.fsa-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(30, 64, 175, 0.2);
  border-top-color: #1e40af;
  border-radius: 50%;
  animation: fsa-spin 0.8s linear infinite;
}

@keyframes fsa-spin {
  to { transform: rotate(360deg); }
}

.fsa-error,
.fsa-summary,
.fsa-fetch-info {
  margin-top: 22px;
  padding: 17px;
  border-radius: 12px;
}

.fsa-error {
  color: var(--fsa-error-text);
  background: var(--fsa-error-bg);
  border: 1px solid #fecaca;
  line-height: 1.7;
}

.fsa-summary {
  background: #f8fafc;
  border: 1px solid var(--fsa-line);
}

.fsa-fetch-info {
  color: #1e3a5f;
  background: var(--fsa-accent-soft);
  border: 1px solid #c7d7fe;
}

.fsa-fetch-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.fsa-fetch-info-item {
  min-width: 0;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(36, 87, 214, 0.12);
  border-radius: 8px;
}

.fsa-fetch-info-label {
  display: block;
  margin-bottom: 2px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}

.fsa-fetch-info-value {
  display: block;
  color: #1e3a5f;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.fsa-section {
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid var(--fsa-line);
}

.fsa-app .fsa-section > .fsa-section-title {
  display: block !important;
  position: static !important;
  width: auto !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--fsa-text) !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  line-height: 1.45 !important;
  letter-spacing: normal !important;
  text-align: left !important;
  text-shadow: none !important;
}

.fsa-app .fsa-section > .fsa-section-title::before,
.fsa-app .fsa-section > .fsa-section-title::after {
  display: none !important;
  content: none !important;
}

.fsa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fsa-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.fsa-stat {
  padding: 14px;
  background: var(--fsa-soft);
  border: 1px solid var(--fsa-line);
  border-radius: 10px;
}

.fsa-stat-label {
  display: block;
  margin-bottom: 4px;
  color: var(--fsa-muted);
  font-size: 11px;
}

.fsa-stat-value {
  display: block;
  color: var(--fsa-text);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.fsa-item {
  padding: 12px 13px;
  background: var(--fsa-soft);
  border: 1px solid var(--fsa-line);
  border-radius: 9px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.fsa-item-wide {
  grid-column: 1 / -1;
}

.fsa-label {
  display: block;
  margin-bottom: 3px;
  color: #273449;
  font-size: 13px;
  font-weight: 800;
}

.fsa-warning,
.fsa-ok,
.fsa-note {
  padding: 11px 13px;
  border-radius: 9px;
  line-height: 1.65;
}

.fsa-warning + .fsa-warning {
  margin-top: 8px;
}

.fsa-warning {
  color: var(--fsa-warn-text);
  background: var(--fsa-warn-bg);
  border: 1px solid #fed7aa;
}

.fsa-ok {
  color: var(--fsa-ok-text);
  background: var(--fsa-ok-bg);
  border: 1px solid #bbf7d0;
}

.fsa-note {
  margin-top: 10px;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid var(--fsa-line);
  font-size: 12px;
}

.fsa-note--top {
  margin: 0 0 20px;
}

.fsa-heading-row {
  position: relative;
  margin: 7px 0;
  padding: 10px 12px;
  background: #fafafa;
  border: 1px solid var(--fsa-line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.fsa-heading-tag {
  display: inline-block;
  min-width: 34px;
  margin-right: 8px;
  color: #475569;
  font-weight: 850;
}

.fsa-details {
  margin-top: 12px;
  border: 1px solid var(--fsa-line);
  border-radius: 10px;
  overflow: hidden;
}

.fsa-details summary {
  padding: 13px 15px;
  background: #f8fafc;
  color: #334155;
  font-weight: 750;
  cursor: pointer;
}

.fsa-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.fsa-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 12px;
}

.fsa-table th,
.fsa-table td {
  padding: 11px 12px;
  border-top: 1px solid var(--fsa-line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.fsa-table th {
  color: #334155;
  background: #f8fafc;
  white-space: nowrap;
}

.fsa-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.fsa-badge--internal { color: #166534; background: #dcfce7; }
.fsa-badge--external { color: #1d4ed8; background: #dbeafe; }
.fsa-badge--page { color: #6d28d9; background: #ede9fe; }
.fsa-badge--contact { color: #9a3412; background: #ffedd5; }
.fsa-badge--other { color: #475569; background: #e2e8f0; }
.fsa-badge--invalid { color: #991b1b; background: #fee2e2; }

.fsa-code {
  max-height: 420px;
  margin-top: 10px;
  padding: 14px;
  overflow: auto;
  border-radius: 8px;
  background: #111827;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fsa-muted {
  color: var(--fsa-muted);
  font-size: 12px;
}

.fsa-app [hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .fsa-box {
    padding: 20px;
    border-radius: 14px;
  }

  .fsa-mode-panel {
    padding: 18px;
  }

  .fsa-tabs {
    grid-template-columns: 1fr;
  }

  .fsa-fetch-info-grid,
  .fsa-grid,
  .fsa-stats {
    grid-template-columns: 1fr;
  }

  .fsa-item-wide {
    grid-column: auto;
  }

  .fsa-textarea {
    min-height: 250px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fsa-spinner {
    animation-duration: 1.6s;
  }

  .fsa-tab,
  .fsa-primary-button,
  .fsa-input,
  .fsa-textarea {
    transition: none;
  }
}
