/* ===== リセット・ベース ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  color: #333;
  background: #f0f4f8;
}

/* ===== ヘッダー ===== */
header {
  background: #1a3a5c;
  color: white;
  padding: 0 40px;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-size: 1.1rem;
  font-weight: bold;
  white-space: nowrap;
}

header h1 a {
  color: white;
  text-decoration: none;
}

.header-sub {
  font-size: 0.6rem;
  font-weight: normal;
  color: rgba(255,255,255,0.5);
  margin-left: 8px;
}

/* ===== ナビゲーション ===== */
.app-nav {
  display: flex;
  gap: 4px;
}

.app-nav-link {
  padding: 6px 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
}

.app-nav-link:hover {
  color: #f0a500;
}

.app-nav-link.active {
  color: white;
  border-bottom-color: #f0a500;
}

/* ポートフォリオに戻るリンク */
.app-nav-back {
  color: rgba(255,255,255,0.5) !important;
  font-size: 0.78rem;
  border-right: 1px solid rgba(255,255,255,0.15);
  padding-right: 18px;
  margin-right: 4px;
}

.app-nav-back:hover {
  color: #f0a500 !important;
}

.app-nav-back::before {
  content: '\2190 ';
}

/* ===== ハンバーガーボタン ===== */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
}

/* ===== ヘッダー右側 ===== */
.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  justify-content: flex-end;
}

.header-user span {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
}

.btn-logout {
  padding: 6px 16px;
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.25);
}

/* ===== メインコンテナ ===== */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ===== 検索エリア ===== */
.search-section {
  background: white;
  border-radius: 14px;
  padding: 28px 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 24px;
}

.search-section-title {
  font-size: 0.85rem;
  color: #888;
  font-weight: 600;
  margin-bottom: 14px;
}

.search-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.search-field label {
  font-size: 0.78rem;
  color: #888;
  font-weight: 600;
}

.search-input {
  padding: 12px 16px;
  border: 2px solid #e0e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.search-input:focus {
  outline: none;
  border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}

.btn-search {
  padding: 12px 32px;
  background: #1a3a5c;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-search:hover {
  background: #15305a;
}

.btn-search:disabled {
  background: #aaa;
  cursor: default;
}

.search-name-hint {
  font-size: 1rem;
  color: #1a3a5c;
  font-weight: bold;
  align-self: center;
}

/* ===== サジェストドロップダウン ===== */
.suggest-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #d0d8e4;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
  margin-top: 4px;
}

.suggest-section-label {
  font-size: 0.72rem;
  color: #aaa;
  font-weight: 600;
  padding: 8px 14px 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.suggest-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #f0f4f8;
  transition: background 0.1s;
}

.suggest-item:last-child {
  border-bottom: none;
}

.suggest-item:hover,
.suggest-item.active {
  background: #e8f0fa;
}

.suggest-code {
  font-weight: bold;
  color: #1a3a5c;
  min-width: 3.5em;
  font-size: 0.92rem;
}

.suggest-name {
  font-size: 0.82rem;
  color: #555;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggest-industry {
  font-size: 0.72rem;
  color: #aaa;
  white-space: nowrap;
}

/* ===== 検索履歴 ===== */
.history-item {
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #f0f4f8;
  transition: background 0.1s;
}

.history-item:hover,
.history-item.active {
  background: #f5f8fc;
}

.history-icon {
  color: #ccc;
  font-size: 0.82rem;
}

/* ===== 初期表示（検索プロンプト） ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #aaa;
}

.empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ===== エラーメッセージ ===== */
.error-msg {
  background: #fdecea;
  color: #c0392b;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* ===== ローディング ===== */
.loading-overlay {
  text-align: center;
  padding: 60px;
  color: #888;
  font-size: 0.95rem;
}

.loading-dots::after {
  content: '';
  animation: dots 1.2s infinite;
}

@keyframes dots {
  0%   { content: ''; }
  33%  { content: '.'; }
  66%  { content: '..'; }
  100% { content: '...'; }
}

/* ===== フッター ===== */
footer {
  background: #1a3a5c;
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 24px;
  font-size: 0.82rem;
  margin-top: 40px;
}

footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  margin: 0 12px;
}

footer a:hover {
  color: white;
}

/* ===== ログインページ ===== */
.login-wrap {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-card h2 {
  font-size: 1.5rem;
  color: #1a3a5c;
  margin-bottom: 8px;
}

.login-card p {
  color: #666;
  font-size: 0.93rem;
  margin-bottom: 24px;
  line-height: 1.7;
}

.login-card .sub {
  color: #888;
  font-size: 0.88rem;
  margin-bottom: 28px;
}

.login-error {
  background: #fff0f0;
  border: 1px solid #ffcccc;
  border-radius: 8px;
  padding: 12px 16px;
  color: #cc0000;
  font-size: 0.88rem;
  margin-bottom: 20px;
  display: none;
}

.login-loading {
  display: none;
  color: #666;
  font-size: 0.93rem;
  margin-top: 16px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
}

.btn-google:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  border-color: #bbb;
}

.btn-google svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.login-divider {
  margin: 28px 0;
  border: none;
  border-top: 1px solid #eee;
}

.login-note {
  font-size: 0.82rem;
  color: #999;
  line-height: 1.7;
}

.login-note a {
  color: #2e6da4;
  text-decoration: none;
}

/* ===== gain / loss 色 ===== */
.gain { color: #1a6e2e; }
.loss { color: #c0392b; }

/* ===== 銘柄ヘッダー ===== */
.stock-header {
  background: #1a3a5c;
  color: white;
  border-radius: 14px;
  padding: 20px 28px;
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.stock-header-code {
  font-size: 1.1rem;
  font-weight: bold;
  opacity: 0.8;
}

.stock-header-name {
  font-size: 1.5rem;
  font-weight: bold;
}

.stock-header-meta {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ===== KPIグリッド ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-card {
  background: white;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  text-align: center;
}

.kpi-label {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 6px;
  line-height: 1.3;
  font-weight: 600;
}

.kpi-value {
  font-size: 1.3rem;
  font-weight: bold;
  color: #1a3a5c;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.kpi-sub {
  font-size: 0.72rem;
  color: #aaa;
  margin-top: 4px;
}

/* KPI前年比矢印 */
.kpi-arrow {
  font-size: 0.7em;
  margin-left: 2px;
}

.kpi-up {
  color: #1a6eb5;
}

.kpi-down {
  color: #c0392b;
}

.kpi-flat {
  color: #aaa;
  font-size: 0.6em;
}

/* ===== チャートグリッド ===== */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: white;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
}

.chart-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.chart-card-title {
  font-size: 0.92rem;
  font-weight: bold;
  color: #1a3a5c;
  border-bottom: 1px solid #e8eef5;
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.chart-note {
  font-size: 0.72rem;
  color: #aaa;
  margin-top: 8px;
}

/* ===== 株価チャート ===== */
.price-chart-section {
  margin-bottom: 24px;
}

.price-period-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.price-period-btn {
  padding: 6px 16px;
  border: 1px solid #c8d2dc;
  background: white;
  color: #1a3a5c;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.12s;
  min-height: 32px;
}

.price-period-btn:hover {
  background: #eef3f8;
}

.price-period-btn.active {
  background: #1a3a5c;
  color: white;
  border-color: #1a3a5c;
}

.price-chart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: #444;
}

.price-chart-meta span b {
  color: #1a3a5c;
  font-weight: 600;
}

.price-chart-wrap {
  position: relative;
  width: 100%;
  height: 340px;
}


/* ===== レスポンシブ ===== */

/* --- 900px以下：ハンバーガーメニュー --- */
@media (max-width: 900px) {
  header {
    padding: 0 16px;
  }

  .hamburger-btn {
    display: block;
  }

  .app-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    background: #1a3a5c;
    padding: 6px 0;
    z-index: 200;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  }

  .app-nav.open {
    display: flex;
  }

  .app-nav-link {
    padding: 14px 24px;
    border-radius: 0;
    border-bottom: none;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .app-nav-link.active {
    background: rgba(255,255,255,0.1);
    border-bottom: none;
  }

  .app-nav-back {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-right: 24px;
    margin-right: 0;
    margin-bottom: 4px;
  }

  .header-user {
    min-width: auto;
  }

  .header-user span {
    display: none;
  }
}

/* --- 768px以下：モバイル --- */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .app-container {
    padding: 16px 12px;
  }

  .search-section {
    padding: 16px 14px;
  }

  .search-row {
    flex-direction: column;
    gap: 10px;
  }

  .search-field {
    width: 100%;
    max-width: none;
  }

  .search-input {
    min-height: 44px;
    font-size: 16px; /* iOSズーム防止 */
  }

  .btn-search {
    width: 100%;
    min-height: 44px;
  }

  .btn-logout {
    min-height: 44px;
    padding: 10px 16px;
  }

  .login-card {
    padding: 32px 20px;
  }

  .header-sub {
    display: none;
  }

  /* KPIグリッド: 2カラム */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .kpi-card {
    padding: 12px 10px;
  }

  .kpi-value {
    font-size: 1.1rem;
  }

  .kpi-label {
    font-size: 0.72rem;
  }

  .kpi-sub {
    font-size: 0.70rem;
  }

  /* チャート: 1カラム */
  .chart-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .chart-card {
    padding: 14px 12px;
  }

  .chart-note {
    font-size: 0.70rem;
  }

  /* 銘柄ヘッダー */
  .stock-header {
    padding: 14px 16px;
    gap: 8px;
    border-radius: 10px;
  }

  .stock-header-name {
    font-size: 1.2rem;
  }

  /* 株価チャート */
  .price-chart-wrap {
    height: 260px;
  }

  .price-period-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
    min-height: 36px;
  }

  .price-chart-meta {
    gap: 8px;
    font-size: 0.78rem;
  }

  /* 財務テーブル - 横スクロール */
  .fin-table-scroll {
    margin: 0 -12px;
    padding: 0 12px;
  }

  .fin-table {
    font-size: 0.75rem;
    min-width: 600px;
  }

  .fin-table th,
  .fin-table td {
    padding: 6px 8px;
  }
}

/* ===== 配当利回り推移チャート ===== */
.yield-history-section {
  margin-bottom: 24px;
}

.yield-history-label {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: bold;
  padding: 4px 14px;
  border-radius: 14px;
  margin-bottom: 12px;
}

.yield-history-label--cheap {
  background: #e6f7ee;
  color: #1a6e2e;
}

.yield-history-label--expensive {
  background: #fde8e8;
  color: #c0392b;
}

.yield-history-label--nodata {
  background: #f0f4f8;
  color: #888;
  font-weight: normal;
}

.yield-history-wrap {
  position: relative;
  width: 100%;
}

.yield-history-nodata {
  text-align: center;
  padding: 40px;
  color: #aaa;
  font-size: 0.90rem;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .yield-history-label {
    font-size: 0.78rem;
    padding: 3px 10px;
  }
}

/* ======================================================
   スクリーナー以下は別セクション
   ====================================================== */

/* ======================================================
   スクリーナー（screener.html）
   ====================================================== */

.screener-container {
  max-width: 1400px;
}

/* ── 説明カード ── */
.screener-info-card {
  background: white;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.screener-info-title {
  font-size: 1.05rem;
  font-weight: bold;
  color: #1a3a5c;
  margin-bottom: 6px;
}

.screener-info-desc {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.6;
}

.screener-info-meta {
  font-size: 0.78rem;
  color: #888;
  margin-top: 8px;
}

/* ── フィルタバー ── */
.screener-filter-bar {
  background: white;
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.screener-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.84rem;
  color: #1a3a5c;
}

.screener-filter-group label {
  font-weight: 600;
  font-size: 0.75rem;
  color: #888;
}

.screener-filter-input,
.screener-filter-select {
  padding: 8px 12px;
  border: 2px solid #e0e8f0;
  border-radius: 8px;
  font-size: 0.84rem;
  color: #222;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.screener-filter-input:focus,
.screener-filter-select:focus {
  outline: none;
  border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}

.screener-filter-input {
  min-width: 180px;
}

.screener-filter-reset {
  padding: 8px 18px;
  background: #f0f4f8;
  color: #555;
  border: 2px solid #e0e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s;
  align-self: flex-end;
}

.screener-filter-reset:hover {
  background: #e0e8f0;
  color: #1a3a5c;
}

.screener-filter-summary {
  margin-left: auto;
  font-size: 0.85rem;
  color: #555;
  align-self: flex-end;
  padding-bottom: 4px;
}

.screener-filter-summary b {
  color: #1a3a5c;
  font-size: 1.1rem;
}

/* ── テーブルカード ── */
.screener-table-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.screener-loading {
  text-align: center;
  padding: 60px;
  color: #888;
  font-size: 0.92rem;
}

.screener-no-data {
  text-align: center;
  padding: 40px;
  color: #aaa;
  font-size: 0.90rem;
}

.screener-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  background:
    linear-gradient(to right, white 30%, rgba(255,255,255,0)),
    linear-gradient(to left, white 30%, rgba(255,255,255,0)),
    linear-gradient(to right, rgba(0,0,0,0.08), rgba(0,0,0,0)),
    linear-gradient(to left, rgba(0,0,0,0.08), rgba(0,0,0,0));
  background-position: left center, right center, left center, right center;
  background-repeat: no-repeat;
  background-size: 20px 100%, 20px 100%, 10px 100%, 10px 100%;
  background-attachment: local, local, scroll, scroll;
}

/* ── テーブル本体 ── */
.screener-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
  min-width: 800px;
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
}

/* 列幅定義 */
.scr-col-no     { width: 44px; }
.scr-col-stock  { width: 200px; }
.scr-col-gyoshu { width: 140px; }
.scr-col-price  { width: 90px; }
.scr-col-high   { width: 120px; }
.scr-col-drop   { width: 90px; }
.scr-col-yield  { width: 90px; }

.screener-table th {
  background: #1a3a5c;
  color: white;
  padding: 10px 10px;
  text-align: left;
  white-space: nowrap;
  line-height: 1.3;
  height: 44px;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  border-bottom: 2px solid #0f2942;
  transition: background 0.12s;
}

.screener-table th:first-child {
  border-radius: 8px 0 0 0;
}

.screener-table th:last-child {
  border-radius: 0 8px 0 0;
}

.screener-table th:hover {
  background: #234976;
}

.scr-sort-arrow {
  font-size: 0.7em;
  margin-left: 4px;
  opacity: 0.8;
}

.screener-table td {
  padding: 10px 10px;
  vertical-align: middle;
  border-bottom: 1px solid #eef2f7;
  height: 44px;
  text-align: left;
  transition: background 0.1s;
}

/* ストライプ */
.screener-table tbody tr:nth-child(even) td {
  background: #fafbfd;
}

/* ホバー */
.screener-table tbody tr:hover td {
  background: #e8f0fa;
}

.scr-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.scr-center {
  text-align: center !important;
}

/* 銘柄セル */
.scr-stock-wrap {
  line-height: 1.4;
}

.scr-stock-code {
  display: block;
  font-size: 0.82rem;
  font-weight: bold;
  color: #1a4a7a;
  text-decoration: underline;
  text-decoration-color: rgba(26,74,122,0.3);
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.12s;
}

.scr-stock-code:hover {
  color: #f0a500;
  text-decoration-color: #f0a500;
}

.scr-stock-name {
  display: block;
  font-size: 0.78rem;
  color: #555;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 高値セル */
.scr-high-wrap {
  line-height: 1.3;
}

.scr-high-main {
  display: block;
  font-size: 0.84rem;
}

.scr-high-date {
  display: block;
  font-size: 0.70rem;
  color: #888;
  margin-top: 2px;
}

/* 下落率 */
.scr-drop-cell {
  color: #c0392b;
  font-weight: 700;
}

/* 配当利回り良好 */
.scr-yield-good {
  color: #1a6e2e;
  font-weight: 600;
}

/* ── ページネーション ── */
.screener-pager {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 4px;
  justify-content: center;
  font-size: 0.84rem;
  color: #555;
}

.screener-pager-btn {
  padding: 8px 18px;
  border: 2px solid #e0e8f0;
  background: white;
  color: #1a3a5c;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.15s;
}

.screener-pager-btn:hover {
  background: #e8f0fa;
  border-color: #1a3a5c;
}

.screener-pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.screener-page-info {
  padding: 0 8px;
  color: #666;
}

/* ── 配当利回り範囲入力 ── */
.screener-range-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.screener-filter-number {
  padding: 8px 8px;
  border: 2px solid #e0e8f0;
  border-radius: 8px;
  font-size: 0.84rem;
  color: #222;
  background: white;
  width: 72px;
  text-align: right;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.screener-filter-number:focus {
  outline: none;
  border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}

.screener-range-sep {
  font-size: 0.82rem;
  color: #888;
  padding: 0 2px;
}

.screener-range-unit {
  font-size: 0.78rem;
  color: #888;
  white-space: nowrap;
}

/* ── 高度なフィルタ ── */
.screener-advanced-bar {
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  overflow: hidden;
}

.screener-advanced-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.screener-advanced-header:hover {
  background: #f5f9ff;
}

.screener-advanced-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a3a5c;
}

.screener-advanced-chevron {
  font-size: 0.7rem;
  color: #aaa;
  transition: transform 0.2s;
}

.screener-advanced-body {
  display: none;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0 20px 16px;
  border-top: 1px solid #f0f4f8;
}

/* 無効化フィルタ */
.screener-filter-disabled {
  opacity: 0.55;
  position: relative;
}

.screener-filter-disabled input {
  background: #f0f4f8 !important;
  cursor: not-allowed;
  color: #999 !important;
}

.screener-badge-coming {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  color: #888;
  background: #e8ecf0;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  align-self: flex-end;
  margin-bottom: 2px;
}

/* ── スクリーナー レスポンシブ ── */
@media (max-width: 768px) {
  .screener-container {
    padding: 16px 12px;
  }

  .screener-info-card {
    padding: 14px 16px;
  }

  .screener-filter-bar {
    padding: 12px 14px;
    gap: 10px;
  }

  .screener-filter-group {
    flex: 1;
    min-width: 120px;
  }

  .screener-filter-input {
    min-width: 0;
    width: 100%;
  }

  .screener-filter-input,
  .screener-filter-select {
    min-height: 44px;
    font-size: 16px; /* iOSズーム防止 */
  }

  .screener-filter-number {
    width: 60px;
    min-height: 44px;
    font-size: 16px; /* iOSズーム防止 */
  }

  .screener-filter-reset {
    min-height: 44px;
  }

  .screener-filter-summary {
    margin-left: 0;
    flex-basis: 100%;
    text-align: center;
  }

  .screener-advanced-body {
    padding: 0 14px 12px;
    gap: 10px;
  }

  .screener-table-card {
    padding: 12px;
  }

  .screener-table {
    font-size: 0.78rem;
    min-width: 680px;
  }

  .screener-table th,
  .screener-table td {
    padding: 8px 6px;
  }

  .screener-pager-btn {
    padding: 8px 14px;
    font-size: 0.80rem;
    min-height: 44px;
  }
}

/* ======================================================
   米国ETF分析（etf.html）
   ====================================================== */

.etf-section-card {
  background: white;
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 24px;
}

.etf-section-title {
  font-size: 1.05rem;
  font-weight: bold;
  padding-bottom: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid;
}

.etf-section-title--high {
  color: #7a1a1a;
  border-bottom-color: #7a1a1a;
}

.etf-section-title--bond {
  color: #1a3a5c;
  border-bottom-color: #1a3a5c;
}

/* ETF KPIカード行 */
.etf-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.etf-kpi-card {
  background: #f5f8fc;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
}

.etf-kpi-ticker {
  font-size: 0.92rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.etf-kpi-yield {
  font-size: 1.4rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1.2;
}

.etf-kpi-arrow {
  font-size: 0.8em;
  line-height: 1;
}

.etf-kpi-status {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 4px;
  min-height: 1.2em;
}

.etf-kpi-status--cheap {
  color: #1a6eb5;
}

.etf-kpi-status--expensive {
  color: #c0392b;
}

.etf-kpi-avg {
  font-size: 0.72rem;
  color: #aaa;
  margin-top: 4px;
  margin-bottom: 8px;
}

.etf-kpi-price {
  font-size: 0.95rem;
  font-weight: bold;
  color: #333;
}

.etf-kpi-price-sub {
  font-size: 0.72rem;
  color: #aaa;
  margin-top: 2px;
}

/* ETFチャートグリッド */
.etf-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.etf-updated {
  font-size: 0.72rem;
  color: #aaa;
  margin-top: 8px;
  text-align: right;
}

/* ETF レスポンシブ */
@media (max-width: 768px) {
  .etf-section-card {
    padding: 16px 14px;
  }

  .etf-kpi-row {
    gap: 8px;
  }

  .etf-kpi-card {
    padding: 12px 8px;
  }

  .etf-kpi-yield {
    font-size: 1.1rem;
  }

  .etf-kpi-price {
    font-size: 0.85rem;
  }

  .etf-chart-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* ======================================================
   保有銘柄アコーディオン（index.html）
   ====================================================== */

.holdings-panel {
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 24px;
  overflow: hidden;
}

.holdings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.92rem;
  font-weight: bold;
  color: #1a3a5c;
  transition: background 0.15s;
}

.holdings-toggle:hover {
  background: #f5f9ff;
}

.holdings-toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.holdings-badge {
  background: #e8f0fe;
  color: #1a3a5c;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 10px;
}

.holdings-chevron {
  font-size: 0.8rem;
  color: #aaa;
  transition: transform 0.2s;
}

.holdings-chevron.open {
  transform: rotate(180deg);
}

.holdings-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid #f0f4f8;
}

.holdings-body.open {
  display: block;
}

.holdings-search {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #e0e8f0;
  border-radius: 8px;
  font-size: 16px;
  margin: 12px 0 10px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.holdings-search:focus {
  border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}

.holdings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.holding-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f5f8fc;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  font-size: 0.82rem;
}

.holding-item:hover {
  background: #1a3a5c;
  color: white;
  border-color: #1a3a5c;
}

.holding-item:hover .holding-code,
.holding-item:hover .holding-name {
  color: white;
}

.holding-code {
  font-weight: bold;
  color: #1a3a5c;
  font-size: 0.85rem;
  white-space: nowrap;
}

.holding-name {
  color: #666;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.holdings-empty {
  color: #aaa;
  font-size: 0.85rem;
  padding: 12px 0;
}

/* 保有銘柄 レスポンシブ */
@media (max-width: 768px) {
  .holdings-panel {
    border-radius: 10px;
  }

  .holdings-toggle {
    padding: 12px 14px;
    font-size: 0.88rem;
    min-height: 44px;
  }

  .holdings-body {
    padding: 0 12px 12px;
  }

  .holdings-grid {
    grid-template-columns: 1fr 1fr;
  }

  .holdings-search {
    min-height: 44px;
  }
}

/* ======================================================
   銘柄比較（compare.html）
   ====================================================== */

.compare-info-card {
  background: white;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.compare-info-title {
  font-size: 1.05rem;
  font-weight: bold;
  color: #1a3a5c;
  margin-bottom: 6px;
}

.compare-info-desc {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.6;
}

.compare-add-section {
  background: white;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.compare-add-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.compare-slot-info {
  font-size: 0.85rem;
  color: #888;
  font-weight: 600;
  align-self: center;
  white-space: nowrap;
}

/* 選択済みタグ */
.compare-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.compare-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 2px solid;
  background: white;
  font-size: 0.85rem;
  transition: box-shadow 0.15s;
}

.compare-tag:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.compare-tag-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.compare-tag-code {
  font-weight: bold;
  color: #1a3a5c;
}

.compare-tag-name {
  color: #555;
  font-size: 0.82rem;
}

.compare-tag-remove {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #aaa;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}

.compare-tag-remove:hover {
  color: #c0392b;
}

/* レーダーチャート */
.compare-radar-card {
  margin-bottom: 20px;
}

.compare-radar-wrap {
  max-width: 520px;
  margin: 0 auto;
}

/* 比較ページ レスポンシブ */
@media (max-width: 768px) {
  .compare-add-section {
    padding: 16px 14px;
  }

  .compare-add-row {
    flex-direction: column;
    gap: 10px;
  }

  .compare-add-row .search-field {
    width: 100%;
    max-width: none;
  }

  .compare-add-row .btn-search {
    width: 100%;
    min-height: 44px;
  }

  .compare-radar-wrap {
    max-width: 100%;
  }

  .compare-tag {
    padding: 6px 10px;
    font-size: 0.82rem;
  }
}

/* ======================================================
   ウォッチリスト（watchlist.html）
   ====================================================== */

.watchlist-info-card {
  background: white;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.watchlist-info-title {
  font-size: 1.05rem;
  font-weight: bold;
  color: #1a3a5c;
  margin-bottom: 6px;
}

.watchlist-info-desc {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.6;
}

.watchlist-add-section {
  background: white;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.watchlist-add-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

/* ウォッチリストカード */
.watchlist-card {
  background: white;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.watchlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f4f8;
}

.watchlist-count {
  font-size: 0.92rem;
  font-weight: bold;
  color: #1a3a5c;
}

.watchlist-clear-btn {
  padding: 6px 14px;
  background: #fdecea;
  color: #c0392b;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s;
}

.watchlist-clear-btn:hover {
  background: #f8d7da;
}

.watchlist-empty {
  text-align: center;
  padding: 40px 20px;
  color: #aaa;
}

.watchlist-empty .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.watchlist-empty p {
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ウォッチリスト銘柄 */
.watchlist-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.watchlist-item {
  display: flex;
  align-items: center;
  border-radius: 10px;
  background: #f5f8fc;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.watchlist-item:hover {
  background: #e8f0fa;
  border-color: #d0dff0;
}

.watchlist-item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  flex: 1;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.watchlist-item-code {
  font-weight: bold;
  color: #1a3a5c;
  font-size: 0.92rem;
  min-width: 3.5em;
  flex-shrink: 0;
}

.watchlist-item-name {
  font-size: 0.88rem;
  color: #333;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watchlist-item-industry {
  font-size: 0.75rem;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}

.watchlist-item-remove {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #ccc;
  cursor: pointer;
  padding: 14px 16px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}

.watchlist-item-remove:hover {
  color: #c0392b;
}

/* 比較ボタンエリア */
.watchlist-actions {
  text-align: center;
  margin-bottom: 16px;
}

.watchlist-actions .btn-search {
  padding: 12px 40px;
}

/* ウォッチリスト レスポンシブ */
@media (max-width: 768px) {
  .watchlist-add-section {
    padding: 16px 14px;
  }

  .watchlist-add-row {
    flex-direction: column;
    gap: 10px;
  }

  .watchlist-add-row .search-field {
    width: 100%;
    max-width: none;
  }

  .watchlist-add-row .btn-search {
    width: 100%;
    min-height: 44px;
  }

  .watchlist-card {
    padding: 14px 14px;
  }

  .watchlist-item-link {
    padding: 12px 12px;
    gap: 8px;
  }

  .watchlist-item-industry {
    display: none;
  }

  .watchlist-item-remove {
    padding: 12px 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}
