/* ============================================================
 * 株主優待 株価ウィジェット - 案A: カード・ダッシュボード型
 * ============================================================ */
.yutai-stock-widget {
  font-family: 'Hiragino Sans', 'Yu Gothic', sans-serif;
  max-width: 600px;
  margin: 24px auto;
  color: #1e2a4a;
}
.yutai-stock-widget * {
  box-sizing: border-box;
}

/* ===== 株価ヒーロー ===== */
.ysw-hero {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: #fff;
  border-radius: 16px;
  padding: 28px 30px;
  box-shadow: 0 8px 24px rgba(30, 60, 114, 0.25);
  position: relative;
  overflow: hidden;
}
.ysw-hero::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}
.ysw-hero::after {
  content: "";
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}
.ysw-time {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 0.7rem;
  opacity: 0.7;
  z-index: 1;
}
.ysw-company {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.25;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}
.ysw-code {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
  letter-spacing: 0.03em;
}
.ysw-code .ysw-industry {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  font-size: 0.78rem;
  vertical-align: 1px;
}
.ysw-price {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
}
.ysw-price .ysw-yen {
  font-size: 1.1rem;
  font-weight: 500;
  margin-left: 4px;
  opacity: 0.8;
}
.ysw-change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
}
.ysw-change.up {
  background: rgba(80, 230, 130, 0.25);
  color: #d4ffd9;
}
.ysw-change.down {
  background: rgba(255, 100, 100, 0.25);
  color: #ffd4d4;
}
.ysw-change.neutral {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ===== 利回りカード3連 ===== */
.ysw-yields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.ysw-yield-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(30, 42, 74, 0.06);
  border-top: 3px solid #2a5298;
}
.ysw-yield-card.highlight {
  border-top-color: #e74c3c;
  background: linear-gradient(180deg, #fff 0%, #fff5f3 100%);
}
.ysw-yield-label {
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}
.ysw-yield-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1e3c72;
  font-variant-numeric: tabular-nums;
}
.ysw-yield-card.highlight .ysw-yield-value {
  color: #c0392b;
}
.ysw-yield-sub {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ===== 財務指標グリッド ===== */
.ysw-metrics {
  margin-top: 20px;
  background: #fff;
  border-radius: 16px;
  padding: 22px 26px;
  box-shadow: 0 2px 12px rgba(30, 42, 74, 0.08);
}
.ysw-metrics h3 {
  font-size: 0.85rem;
  color: #666;
  margin: 0 0 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.ysw-metrics h3::before {
  content: "";
  width: 4px;
  height: 14px;
  background: #2a5298;
  border-radius: 2px;
}
.ysw-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.ysw-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed #e5e9f2;
}
.ysw-metric-label {
  font-size: 0.85rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ysw-metric-value {
  font-size: 1rem;
  font-weight: 700;
  color: #1e3c72;
  font-variant-numeric: tabular-nums;
}
.ysw-metric-value.loading {
  color: #cbd5e1;
  font-weight: 400;
  font-style: italic;
}
/* ===== 計算根拠ノート ===== */
.ysw-note {
  max-width: 600px;
  margin: 12px auto 0;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.82rem;
  color: #5c4a16;
  line-height: 1.7;
}
.ysw-note .ysw-note-title {
  font-weight: 700;
  color: #92400e;
  margin: 0 0 6px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ysw-note .ysw-note-title::before {
  content: "💡";
  font-size: 0.95rem;
}
.ysw-note p {
  margin: 0;
}
.ysw-note p + p {
  margin-top: 4px;
}

.ysw-metrics-footer {
  margin-top: 14px;
  font-size: 0.7rem;
  color: #94a3b8;
  text-align: center;
}

/* ===== 用語ツールチップボタン ===== */
.term-tip {
  cursor: pointer;
  display: inline-flex;
  width: 16px;
  height: 16px;
  line-height: 1;
  text-align: center;
  border-radius: 50%;
  background: #cbd5e1;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  user-select: none;
  transition: background 0.2s;
}
.term-tip:hover {
  background: #2a5298;
}

/* ===== 用語モーダル ===== */
#yutai-term-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 40, 0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#yutai-term-overlay.active {
  display: flex;
}
#yutai-term-overlay .modal-inner {
  background: #fff;
  border-radius: 14px;
  max-width: 420px;
  width: 90%;
  padding: 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
#yutai-term-overlay .modal-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 10px;
  color: #1e3c72;
}
#yutai-term-overlay .modal-body {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.75;
  margin: 0 0 14px;
}
#yutai-term-overlay .modal-close {
  display: block;
  margin-left: auto;
  background: #2a5298;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
#yutai-term-overlay .modal-close:hover {
  background: #1e3c72;
}

/* ===== モバイル ===== */
@media (max-width: 480px) {
  .yutai-stock-widget {
    margin: 16px 0;
  }
  .ysw-hero {
    padding: 22px 20px;
  }
  .ysw-company {
    font-size: 1.4rem;
  }
  .ysw-price {
    font-size: 2.2rem;
  }
  .ysw-yield-value {
    font-size: 1.1rem;
  }
  .ysw-metric-grid {
    grid-template-columns: 1fr;
  }
  .ysw-metrics {
    padding: 18px 20px;
  }
}
