/* =========================================================
   AIで一人起業の教科書 シミュレーター v1.0
   bizarch-design tone & manner
   - Electric Blue:  #0066FF (main accent)
   - Deep Purple:    #8A2BE2 (secondary accent)
   - Background:     #FFFFFF + Blueprint grid
   - Text primary:   #111827 (gray-900)
   - Text secondary: #6B7280 (gray-500)
   - Border:         #F3F4F6 (gray-100), hover: rgba(0,102,255,0.20)
   Font: Noto Sans JP (300 / 400 / 500 / 700 / 900)
========================================================= */

/* ---------- Reset ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 14px;
  color: #111827;
  background: #FFFFFF;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Blueprint grid background ---------- */
.bg-blueprint {
  background-color: #FFFFFF;
  background-image:
    linear-gradient(rgba(0, 102, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 102, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  position: relative;
  min-height: 100vh;
}

/* ---------- Decorative gradient orbs ---------- */
.orb-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.orb {
  position: absolute;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  filter: blur(60px);
  animation: pulse 4s ease-in-out infinite;
}
.orb-blue {
  background: rgba(0, 102, 255, 0.10);
  top: 25%;
  left: -8rem;
}
.orb-purple {
  background: rgba(138, 43, 226, 0.10);
  bottom: 25%;
  right: -8rem;
  animation-delay: 1s;
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* ---------- Gradient text utility ---------- */
.text-gradient {
  background: linear-gradient(to right, #0066FF, #8A2BE2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Tracking widget label (Architecture × AI 風) ---------- */
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #0066FF;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid #F3F4F6;
}
.header-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.app-header h1 {
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: #111827;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.app-header h1 .hl {
  font-weight: 900;
  background: linear-gradient(to right, #0066FF, #8A2BE2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.app-header .version {
  font-size: 0.75rem;
  color: #6B7280;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.header-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: #0066FF;
  text-transform: uppercase;
}

/* ---------- Main layout (Split-pane) ---------- */
.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 24px 24px 24px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 2fr;
  gap: 28px;
  align-items: stretch;
  position: relative;
  z-index: 1;
  /* Split-pane: ヘッダー + フッター 引いた残り高さ */
  height: calc(100vh - 80px - 64px);
  min-height: 500px;
}

@media (max-width: 980px) {
  .container {
    grid-template-columns: 1fr;
    gap: 20px;
    height: auto;  /* モバイルは縦スタック・通常スクロール */
    padding: 20px 16px 80px;
  }
  .input-panel,
  .output-panel {
    height: auto !important;
    overflow: visible !important;
    max-height: none !important;
  }
  /* iOS auto-zoom 対策：input は最低 16px を強制 */
  .form-control {
    font-size: 16px;
  }
  /* 980px以下では数値入力欄をスライダーと並んだ際に窮屈にしない */
  .form-control.number-narrow {
    width: 100%;
  }
}

/* ---------- Left column: Input panel (Split-pane: 独立スクロール) ---------- */
.input-panel {
  background: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: 1rem;
  padding: 28px;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,102,255,0.3) transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.input-panel::-webkit-scrollbar,
.output-panel::-webkit-scrollbar { width: 6px; }
.input-panel::-webkit-scrollbar-thumb,
.output-panel::-webkit-scrollbar-thumb {
  background: rgba(0,102,255,0.25);
  border-radius: 3px;
}
.input-panel::-webkit-scrollbar-thumb:hover,
.output-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(0,102,255,0.5);
}
/* 右カラムも独立スクロールするためのラッパー */
.output-panel {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,102,255,0.3) transparent;
  padding-right: 4px;
}
.input-panel:hover {
  border-color: rgba(0, 102, 255, 0.20);
  box-shadow: 0 20px 25px -5px rgba(0, 102, 255, 0.05),
              0 8px 10px -6px rgba(0, 102, 255, 0.05);
}

.panel-title {
  font-weight: 900;
  font-size: 1.25rem;
  color: #111827;
  margin-bottom: 4px;
}
.panel-subtitle {
  font-size: 0.8rem;
  color: #6B7280;
  margin-bottom: 22px;
}

.form-section {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #F3F4F6;
}
.form-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #111827;
  margin-bottom: 10px;
}
.form-label .icon {
  width: 18px;
  height: 18px;
  color: #0066FF;
  flex-shrink: 0;
}
.form-label-inline {
  font-size: 0.82rem;
  color: #4B5563;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  background: #FFFFFF;
  color: #111827;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px #0066FF;
}
.form-control.number-narrow {
  width: 110px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.slider-row input[type="range"] {
  flex: 1;
  accent-color: #0066FF;
  height: 4px;
}

.form-help {
  font-size: 0.78rem;
  color: #6B7280;
  margin-top: 8px;
  line-height: 1.5;
}

/* ---------- Radio / Checkbox ---------- */
.radio-group, .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.radio-item, .checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #1F2937;
  cursor: pointer;
  padding: 7px 8px;
  border-radius: 0.5rem;
  transition: background 0.15s, color 0.15s;
}
.radio-item:hover, .checkbox-item:hover {
  background: rgba(0, 102, 255, 0.04);
  color: #0066FF;
}
.radio-item input, .checkbox-item input {
  accent-color: #0066FF;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.custom-salary-row,
.optional-input-row,
.ct-method-row {
  margin-top: 12px;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Right column: Output panel ---------- */
.output-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}
/* output-panel 内の子要素を flex shrink で潰さない */
.output-panel > * {
  flex-shrink: 0;
}

/* ---------- Result card (main number) ---------- */
.result-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: 1rem;
  padding: 36px 36px 32px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0,102,255,0.25), rgba(138,43,226,0.25));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.result-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 102, 255, 0.08),
              0 8px 10px -6px rgba(138, 43, 226, 0.06);
}
.card-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #0066FF;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.card-amount {
  font-weight: 900;
  font-size: 3.6rem;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
  /* 単色フォールバック（グラデーション失敗時用） */
  color: #0066FF;
  /* グラデーションテキスト */
  background-image: linear-gradient(to right, #0066FF, #8A2BE2);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  transition: opacity 0.3s;
}
/* グラデーション非対応ブラウザ用フォールバック */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .card-amount {
    color: #0066FF;
    -webkit-text-fill-color: #0066FF;
    background: none;
  }
}
.card-breakdown {
  font-size: 0.92rem;
  color: #4B5563;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.card-breakdown b {
  color: #111827;
  font-weight: 800;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  margin: 0 2px;
  transition: color 0.3s;
}
.card-breakdown .sep {
  color: #9CA3AF;
  font-weight: 300;
}
.card-meta {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #F3F4F6;
  font-size: 0.82rem;
  color: #6B7280;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.card-meta #pattern-label {
  font-weight: 700;
  color: #0066FF;
}

/* ---------- Warning ---------- */
.warning-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.warning-area:empty {
  display: none;
}
.warning-item {
  background: rgba(245, 158, 11, 0.08);
  color: #92400E;
  padding: 12px 16px;
  border-radius: 0.75rem;
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 0.86rem;
  font-weight: 500;
}

/* ---------- Section title ---------- */
.section-title {
  font-weight: 800;
  font-size: 1.35rem;
  color: #111827;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title .icon {
  width: 22px;
  height: 22px;
  color: #0066FF;
}
.section-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: #0066FF;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ---------- Compare / P&L / Sens cards ---------- */
.compare-section, .pl-section, .sens-section {
  background: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: 1rem;
  padding: 28px 30px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.compare-section:hover,
.pl-section:hover,
.sens-section:hover {
  border-color: rgba(0, 102, 255, 0.20);
  box-shadow: 0 20px 25px -5px rgba(0, 102, 255, 0.05),
              0 8px 10px -6px rgba(0, 102, 255, 0.05);
}
.table-wrap {
  overflow-x: auto;
}

/* ---------- Compare table ---------- */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.compare-table th,
.compare-table td {
  padding: 10px 14px;
  text-align: right;
  border-bottom: 1px solid #F3F4F6;
}
.compare-table th:first-child,
.compare-table td:first-child {
  text-align: left;
  color: #4B5563;
  font-weight: 600;
}
.compare-table thead th {
  background: linear-gradient(to right, #0066FF, #8A2BE2);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  text-align: center;
  border: none;
  padding: 12px 14px;
}
.compare-table thead th:first-child {
  background: linear-gradient(to right, #0066FF, #2D6FFF);
  color: #FFFFFF;
  text-align: left;
  border-radius: 0.5rem 0 0 0;
}
.compare-table thead th:last-child {
  border-radius: 0 0.5rem 0 0;
}
.compare-table tbody td:not(:first-child) {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #111827;
  transition: background 0.3s, color 0.3s;
}
.compare-table .total-row {
  background: rgba(0, 102, 255, 0.03);
  font-weight: 800;
}
.compare-table .total-row td {
  border-top: 2px solid rgba(0, 102, 255, 0.2);
  font-size: 1.05rem;
  color: #111827;
  padding: 14px;
}
.compare-table .total-row td:first-child {
  color: #0066FF;
}
.compare-table td.winner {
  background: rgba(16, 185, 129, 0.10);
  color: #047857;
  position: relative;
}
.compare-table .total-row td.winner {
  background: rgba(16, 185, 129, 0.18);
  color: #065F46;
  font-weight: 900;
}
.compare-note {
  margin-top: 12px;
  font-size: 0.82rem;
  color: #6B7280;
  line-height: 1.6;
}

/* ---------- Detail P&L ---------- */
.pl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 720px) {
  .pl-grid {
    grid-template-columns: 1fr;
  }
}
.pl-card {
  background: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: 0.75rem;
  padding: 20px 22px;
  transition: border-color 0.3s;
}
.pl-card:hover {
  border-color: rgba(0, 102, 255, 0.2);
}
.pl-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F3F4F6;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pl-card-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(to bottom, #0066FF, #8A2BE2);
}
.pl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.pl-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #F9FAFB;
}
.pl-table td:first-child {
  color: #4B5563;
}
.pl-table td.num {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #111827;
  transition: color 0.3s;
}
.pl-table td.num.minus {
  color: #DC2626;
}
.pl-table .row-bold td {
  font-weight: 800;
  background: rgba(0, 102, 255, 0.04);
  color: #111827;
  border-top: 1px solid rgba(0, 102, 255, 0.15);
}
.pl-table .row-bold td:first-child {
  color: #0066FF;
}
.pl-table .row-highlight td {
  font-weight: 900;
  font-size: 0.98rem;
  background: linear-gradient(to right, rgba(0,102,255,0.06), rgba(138,43,226,0.06));
  border-top: 2px solid;
  border-image: linear-gradient(to right, #0066FF, #8A2BE2) 1;
}
.pl-table .row-highlight td:first-child {
  color: #0066FF;
}
.pl-table .row-highlight td.num {
  background: linear-gradient(to right, #0066FF, #8A2BE2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.08rem;
}

/* ---------- Sensitivity table ---------- */
.sens-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.sens-table th, .sens-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #F3F4F6;
  text-align: right;
}
.sens-table th {
  background: rgba(0, 102, 255, 0.04);
  color: #0066FF;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sens-table th:first-child { border-radius: 0.5rem 0 0 0; }
.sens-table th:last-child  { border-radius: 0 0.5rem 0 0; }
.sens-table td:first-child, .sens-table th:first-child {
  text-align: left;
}
.sens-table td:not(:first-child) {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #111827;
}
.sens-table .baseline-row {
  background: linear-gradient(to right, rgba(0,102,255,0.06), rgba(138,43,226,0.06));
  font-weight: 800;
}
.sens-table .baseline-row td:first-child {
  color: #0066FF;
}
.sens-table .diff-positive { color: #047857; }
.sens-table .diff-negative { color: #DC2626; }

/* ---------- Page footer ---------- */
.page-footer {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #6B7280;
  background: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: 0.75rem;
  padding: 18px 22px;
  line-height: 1.6;
}
.page-footer a {
  color: #0066FF;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
.page-footer a:hover {
  color: #8A2BE2;
  text-decoration: underline;
}
.page-footer .disclaimer-short {
  background: linear-gradient(to right, rgba(0,102,255,0.04), rgba(138,43,226,0.04));
  border-left: 3px solid #0066FF;
  padding: 10px 14px;
  border-radius: 0.5rem;
  margin: 0 0 12px 0;
  color: #374151;
  font-size: 0.78rem;
}
.page-footer .disclaimer-details {
  margin: 8px 0 12px 0;
  font-size: 0.75rem;
}
.page-footer .disclaimer-details summary {
  cursor: pointer;
  color: #0066FF;
  font-weight: 600;
  user-select: none;
  padding: 4px 0;
}
.page-footer .disclaimer-details summary:hover {
  color: #8A2BE2;
}
.page-footer .disclaimer-details ul {
  margin: 8px 0;
  padding-left: 20px;
}
.page-footer .footer-note {
  margin: 6px 0 0 0;
  color: #6B7280;
  font-size: 0.75rem;
}

/* ---------- Site footer (Split-pane: sticky bottom) ---------- */
.site-footer {
  position: sticky;
  bottom: 0;
  margin-top: 0;
  border-top: 1px solid #F3F4F6;
  padding: 14px 24px;
  text-align: center;
  font-size: 0.78rem;
  color: #6B7280;
  letter-spacing: 0.05em;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
@media (max-width: 980px) {
  .site-footer {
    position: static;
    margin-top: 40px;
    padding: 24px 0;
    background: transparent;
    backdrop-filter: none;
  }
}
.site-footer .brand {
  font-weight: 700;
  background: linear-gradient(to right, #0066FF, #8A2BE2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Disabled state ---------- */
.form-control:disabled,
input:disabled {
  opacity: 0.4;
  background: #F9FAFB;
  color: #9CA3AF;
  cursor: not-allowed;
}

/* ---------- Focus visible (keyboard a11y) ---------- */
*:focus-visible {
  outline: 2px solid #0066FF;
  outline-offset: 2px;
}

/* ---------- Responsive table wrappers ---------- */
.compare-table-wrap,
.sens-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Smooth number-change transitions ---------- */
.card-amount,
.card-breakdown b,
.compare-table tbody td:not(:first-child),
.pl-table td.num,
.sens-table td:not(:first-child) {
  transition: color 0.3s ease, background-color 0.3s ease;
}

/* ---------- AI Tools Cost Card ---------- */
.ai-tools-card {
  margin-top: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg,
    rgba(0, 102, 255, 0.04),
    rgba(138, 43, 226, 0.04));
  border: 1px solid rgba(0, 102, 255, 0.15);
  border-radius: 0.75rem;
  position: relative;
  overflow: hidden;
}
.ai-tools-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0,102,255,0.30), rgba(138,43,226,0.30));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.ai-tools-stack-label,
.ai-tools-amount-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #0066FF;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.ai-tools-stack {
  font-size: 0.86rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 14px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.ai-tools-amount-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid rgba(0, 102, 255, 0.12);
}
.ai-tools-monthly-block,
.ai-tools-annual-block {
  flex: 1;
}

.ai-tools-amount-value {
  font-weight: 900;
  font-size: 1.7rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(to right, #0066FF, #8A2BE2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}
.ai-tools-amount-value-sub {
  font-weight: 800;
  font-size: 1.2rem;
  color: #4B5563;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.ai-tools-amount-value .unit,
.ai-tools-amount-value-sub .unit {
  font-size: 0.65em;
  font-weight: 600;
  color: #6B7280;
  margin-left: 4px;
  background: none;
  -webkit-text-fill-color: #6B7280;
}

.ai-tools-fit {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 102, 255, 0.15);
  font-size: 0.78rem;
  color: #4B5563;
  font-weight: 500;
}
.ai-tools-fit::before {
  content: "→ ";
  color: #0066FF;
  font-weight: 700;
}

.ai-tools-warning {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.10);
  border-left: 3px solid #F59E0B;
  border-radius: 0.375rem;
  font-size: 0.76rem;
  color: #92400E;
  font-weight: 500;
  display: none;
}
.ai-tools-warning.is-active {
  display: block;
}

/* ---------- P&L sub-detail row (うちAIツール代) ---------- */
.pl-table tr.row-sub td {
  padding-top: 2px;
  padding-bottom: 6px;
  border-bottom: none;
}
.pl-table tr.row-sub td:first-child {
  color: #9CA3AF;
  font-size: 0.78rem;
  font-weight: 500;
}
.pl-table td.sub-detail {
  color: #6B7280;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Result card action buttons (Copy / Share URL) ---------- */
.card-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 2;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.card-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0066FF;
  background: rgba(0, 102, 255, 0.05);
  border: 1px solid rgba(0, 102, 255, 0.20);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
  letter-spacing: 0.01em;
}
.card-action-btn:hover {
  background: rgba(0, 102, 255, 0.10);
  border-color: rgba(0, 102, 255, 0.45);
  color: #0050CC;
}
.card-action-btn:active {
  transform: translateY(1px);
}
.card-action-btn.is-success {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.45);
  color: #047857;
}
.icon-sm {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .card-actions {
    position: static;
    margin-bottom: 12px;
    justify-content: flex-start;
  }
  .card-action-label {
    display: inline;
  }
}

/* ---------- Copy toast (one-shot feedback) ---------- */
.copy-toast {
  position: absolute;
  bottom: 18px;
  right: 18px;
  background: linear-gradient(to right, #0066FF, #8A2BE2);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 0.5rem;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 16px -4px rgba(0, 102, 255, 0.30);
  z-index: 2;
}
.copy-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Scroll-to-top floating button ---------- */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0066FF, #8A2BE2);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 10px 20px -6px rgba(0, 102, 255, 0.35),
              0 6px 10px -4px rgba(138, 43, 226, 0.25);
  z-index: 200;
}
.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  box-shadow: 0 14px 28px -6px rgba(0, 102, 255, 0.45),
              0 8px 14px -4px rgba(138, 43, 226, 0.35);
}
.scroll-top-btn:active {
  transform: translateY(1px);
}
.scroll-top-btn svg {
  width: 22px;
  height: 22px;
}
@media (max-width: 600px) {
  .scroll-top-btn {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
  .scroll-top-btn svg {
    width: 20px;
    height: 20px;
  }
}
