/* ── モバイル: 3指標 sticky バー ── */
#mobile-metrics-sticky[hidden] { display: none !important; }
#mobile-metrics-sticky {
  position: sticky;
  top: 14px;
  z-index: 5;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-bottom: 2px;
}

.mms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1px;
}

.mms-title {
  font-size: 9px;
  font-family: sans-serif;
  color: #C0C8D4;
  letter-spacing: 0.04em;
}

.mms-compare-btn {
  font-size: 10px;
  font-weight: 600;
  font-family: sans-serif;
  color: #4F6EF7;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1.5;
}
.mms-compare-btn:active {
  background: #E0E7FF;
}

.mms-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mms-reset-btn {
  font-size: 10px;
  font-weight: 400;
  font-family: sans-serif;
  color: #9CA3AF;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  padding: 2px 7px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1.5;
}
.mms-reset-btn:active {
  background: #F3F4F6;
  color: #6B7280;
}

.mms-share-btn {
  font-size: 10px;
  font-weight: 500;
  font-family: sans-serif;
  color: #0369A1;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1.5;
}
.mms-share-btn:active {
  background: #E0F2FE;
}

/* ── PC 共有CTAラッパー ── */
#pc-share-wrap {
  display: flex;
  justify-content: center;
  padding: 4px 0 8px;
}
#pc-share-wrap .act-share {
  width: 60%;
  height: 36px;
  font-size: 12px;
  padding: 0 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ── 共有モーダル ── */
#share-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
}
#share-modal[hidden] { display: none !important; }

.share-modal-box {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 22px 20px 16px;
  width: min(92vw, 340px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.share-modal-title {
  font-size: 15px;
  font-weight: 700;
  font-family: sans-serif;
  color: #1E293B;
  margin-bottom: -8px;
}

.share-modal-desc {
  font-size: 12px;
  font-family: sans-serif;
  color: #6B7280;
  line-height: 1.5;
}

/* 画像保存: 補助CTA */
.share-img-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: sans-serif;
  background: #F8FAFC;
  color: #4B7EA6;
  border: 1px solid #D1E9FA;
  border-radius: 8px;
  padding: 8px 0;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, border-color 0.15s;
}
.share-img-btn:hover  { background: #EFF8FF; border-color: #BAE6FD; }
.share-img-btn:active { background: #E0F2FE; }
.share-img-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.share-img-note {
  font-size: 11px;
  font-family: sans-serif;
  color: #9CA3AF;
  text-align: center;
  margin: -8px 0 0;
  line-height: 1.5;
}

/* URL表示 */
.share-url-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.share-url-label {
  font-size: 10px;
  font-family: sans-serif;
  color: #9CA3AF;
  letter-spacing: 0.03em;
}
.share-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.share-url-input {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-family: monospace;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  padding: 6px 8px;
  color: #6B7280;
  background: #F9FAFB;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}

/* SNS: 補助 */
.share-sns-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.share-sns-label {
  font-size: 10px;
  font-family: sans-serif;
  color: #9CA3AF;
  letter-spacing: 0.03em;
}
.share-sns-row {
  display: flex;
  gap: 8px;
}
.share-url-copy-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.share-url-copy-btn:hover  { background: #E2E8F0; color: #334155; }
.share-url-copy-btn:active { background: #CBD5E1; }
.share-url-copy-btn.copied {
  background: #DCFCE7;
  color: #16A34A;
  border-color: #BBF7D0;
}
.share-sns-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  font-family: sans-serif;
  text-decoration: none;
  border-radius: 8px;
  padding: 11px 0;
  cursor: pointer;
  touch-action: manipulation;
}
.share-sns-x    { background: #18181B; color: #FFFFFF; }
.share-sns-x:hover { background: #000000; }
.share-sns-line { background: #06C755; color: #FFFFFF; }
.share-sns-line:hover { background: #05A847; }

.share-modal-close {
  align-self: center;
  font-size: 12px;
  font-family: sans-serif;
  color: #9CA3AF;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 24px;
  margin-top: -4px;
  touch-action: manipulation;
}
.share-modal-close:hover { color: #6B7280; }

/* ── トースト ── */
#share-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #1E293B;
  color: #FFFFFF;
  font-size: 13px;
  font-family: sans-serif;
  padding: 8px 20px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 300;
  white-space: nowrap;
}
#share-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── PC: 現在の配合カード ── */
#pc-metrics-card {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
/* カード内のbars-blockは独自枠を外す */
#pc-metrics-card .bars-block {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  gap: 10px;
}

.mms-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mms-label {
  font-size: 10px;
  font-family: sans-serif;
  color: #6B7280;
  width: 52px;
  flex-shrink: 0;
}

.mms-track {
  flex: 1;
  height: 5px;
  background: #F3F4F6;
  border-radius: 3px;
  overflow: hidden;
}

.mms-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.mms-pct {
  font-size: 11px;
  font-weight: 700;
  font-family: sans-serif;
  color: #374151;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ════════════════════════════
   右パネル: グラフ
   ════════════════════════════ */
.rp-header {
  padding-bottom: 12px;
  border-bottom: 1px solid #E5E7EB;
}

.rp-title {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  font-family: sans-serif;
  letter-spacing: -0.01em;
}

/* ── 評価ラベル ── */
#eval-block {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 12px;
  padding: 14px 16px;
}

#eval-main {
  font-size: 17px;
  font-weight: 800;
  color: #15803D;
  font-family: sans-serif;
  line-height: 1.2;
}

#eval-sub {
  font-size: 12px;
  color: #6B7280;
  font-family: sans-serif;
  margin-top: 4px;
}

/* ── バーグラフ ── */
.bars-block {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-icon {
  font-size: 12px;
  width: 14px;
  text-align: center;
  color: #9CA3AF;
  flex-shrink: 0;
}

.bar-label {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  font-family: sans-serif;
  width: 62px;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 14px;
  background: #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 8px;
  transition: width 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-drainage { background: #0284C7; }
.bar-water    { background: #16A34A; }
.bar-aeration { background: #64748B; }
.bar-nutrient { background: #D97706; }

.bar-pct {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  font-family: sans-serif;
  min-width: 38px;
  text-align: right;
  flex-shrink: 0;
}

/* ── 有機/無機スプリットバー ── */
.chart-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 12px 14px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.chart-label {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  font-family: sans-serif;
  letter-spacing: 0.01em;
}

.split-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.split-bar-track {
  width: 100%;
  height: 12px;
  background: #94A3B8;
  border-radius: 9999px;
  overflow: hidden;
}

.split-bar-organic {
  height: 100%;
  width: 50%;
  background: #16A34A;
  border-radius: 9999px;
  transition: width 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.split-bar-ends {
  display: flex;
  justify-content: space-between;
}

.split-end-label {
  font-size: 11px;
  font-weight: 700;
  font-family: sans-serif;
}

.split-bar-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.split-label {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  font-family: sans-serif;
}

.split-vals {
  font-size: 12px;
  color: #9CA3AF;
  font-family: sans-serif;
}

/* ── 詳細パラメータ アコーディオン ── */
.detail-accordion {
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
}

.detail-toggle-btn {
  width: 100%;
  padding: 10px 14px;
  background: #FFFFFF;
  border: none;
  border-bottom: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  font-family: sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.detail-toggle-btn:hover {
  background: #F9FAFB;
  color: #374151;
}

.detail-toggle-btn[aria-expanded="true"] {
  border-bottom-color: #E5E7EB;
}

.detail-toggle-label {
  font-size: 13px;
  font-weight: 600;
}

.detail-toggle-chevron {
  font-size: 11px;
  color: #9CA3AF;
}

.detail-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 280ms ease-out;
}

.detail-panel.open {
  max-height: 600px;
}

.detail-inner {
  background: #FFFFFF;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-label {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  font-family: sans-serif;
  width: 62px;
  flex-shrink: 0;
}

.detail-fill { background: #7C3AED; }

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-label-row {
  display: flex;
  align-items: center;
}

.gran-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 8px;
}

.gran-label {
  font-size: 12px;
  color: #9CA3AF;
  font-family: sans-serif;
  width: 28px;
  flex-shrink: 0;
}

.gran-coarse { background: #7C3AED; }
.gran-fine   { background: #C4B5FD; }

/* ── 免責文言（折りたたみ） ── */
#disclaimer-wrap {
  border-top: 1px solid #F3F4F6;
  padding-top: 10px;
  font-family: sans-serif;
}

#disclaimer-summary {
  font-size: 11px;
  font-weight: 600;
  color: #C4C9D4;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 4px;
}
#disclaimer-summary::-webkit-details-marker { display: none; }
#disclaimer-summary::before { content: 'ⓘ'; }
#disclaimer-summary:hover { color: #9CA3AF; }
#disclaimer-wrap[open] #disclaimer-summary { margin-bottom: 4px; }

#disclaimer {
  font-size: 11px;
  color: #9CA3AF;
  font-family: sans-serif;
  line-height: 1.7;
  padding: 0;
  margin: 0;
}

/* ── 配合割合 ── */
#mix-ratio-panel {
  padding-bottom: 10px;
  border-bottom: 1px solid #F3F4F6;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#mix-ratio-panel[hidden] { display: none; }

.mratio-label {
  font-size: 11px;
  font-weight: 700;
  color: #9CA3AF;
  letter-spacing: 0.06em;
  margin: 0;
}
#mix-ratio-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #F3F4F6;
}
.mratio-seg {
  display: block;
  height: 100%;
  transition: width 300ms ease;
}
#mix-ratio-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mratio-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #374151;
}
.mratio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mratio-name { flex: 1; }
.mratio-pct {
  color: #6B7280;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

/* ── 配合サマリーチップ ── */
#mix-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 4px;
}
#mix-summary[hidden] { display: none; }

.mix-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  font-family: sans-serif;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 9999px;
  padding: 3px 10px 3px 7px;
  white-space: nowrap;
}

.mix-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.14);
}

.mix-chip-more {
  color: #9CA3AF;
  font-weight: 500;
  background: #F3F4F6;
  border-color: #E5E7EB;
}

/* ── 影響資材ブロック ── */
#influence-block {
  background: #F8FAFC;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-family: sans-serif;
}
#influence-block[hidden] { display: none; }

.inf-title {
  font-size: 11px;
  font-weight: 700;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 2px;
}

.inf-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  flex-wrap: wrap;
}

.inf-param {
  color: #6B7280;
  font-weight: 600;
  min-width: 50px;
  flex-shrink: 0;
}

.inf-arrow {
  color: #D1D5DB;
  flex-shrink: 0;
}

.inf-mat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: #111827;
}

.inf-mat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.14);
}

.inf-dot {
  color: #D1D5DB;
  padding: 0 1px;
}
