/* ===== charts ページ専用スタイル ===== */

/* コントロール */
.accent {
  color:#2dd4bf;
}
.cat-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;         /* 👈 中央揃え */
  background: #111923;
  padding: 12px 16px;          /* 上下に余裕を持たせる */
}
/* 入力・ボタン */
.cat-controls input,
.cat-controls select,
.cat-controls button {
  border-radius: 10px;
  padding: 10px 12px;           /* フィールド高さを統一 */
  line-height: 1.4;             /* 行間調整で中央寄せ */
  font-size: 14px;
}
.cat-controls .switch {
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
}

/* スライダー帯 */
.slider-wrapper {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  background: #0b0b0b;
  padding: 12px 16px;
  border-top: 1px solid #141414;
  border-bottom: 1px solid #141414;
}
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slider-container input { width: 260px; }

/* カテゴリ枠 */
.cat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 12px 12px;
}
.cat-col {
  background: transparent;    /* 👈 枠や背景は透過 */
  border: none;               /* 👈 外枠削除 */
}
.cat-col > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-weight: 800;
  background: #0b0f14;        /* タイトル行だけ背景を強調 */
}

/* カードグリッド */
.cat-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0;
  padding: 0;
}

/* ミニカード */
.mini {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(var(--mini-h) + var(--title-h));
  border: 1px solid #444;   /* ← カード全体の枠線を付与 */
  border-radius: 8px;       /* お好みで角丸 */
  background: #1c1c1c;      /* JPカード背景と統一 */
}

/* JP/LWC カード */
.mini .title {
  flex: 0 0 var(--title-h);
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  box-sizing: border-box;
  background: #1c1c1c;       /* ← タイトル背景 */
  border-bottom: 1px solid #333; /* ← 下線だけ */
}
.mini .topline { display: flex; flex-direction: column; line-height: 1.2; margin-top: 2px;}
.mini .topline .sym { font-size: 16px; font-weight: 600; margin-bottom: 2px;}
.mini .topline .cname {
  font-size: 11px;
  font-weight: 300;
  opacity: .7; 
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.mini .pricerow {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}
.mini .priceBig { font-size: 28px; font-weight: 500; }
.mini .deltaBig { font-size: 18px; font-weight: 500; }
.delta-pos { color: var(--ok); }
.delta-neg { color: var(--bad); }

/* チャート領域 */
.mini .chart { flex: 1; height: var(--mini-h); }
.tvwrap { width: 100%; height: 100%; }

/* TradingView カード */
.mini.tv .title { display: none; }
.mini.tv .chart { position: relative; }
.mini.tv .tradingview-widget-container,
.mini.tv iframe,
.mini.tv .chart > div {
  height: 100% !important;
  border: 0 !important;
}

/* 操作系 */
.drag-handle {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 40px;
  cursor: grab;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,.28), rgba(0,0,0,0));
}
.card-actions {
  position: absolute;
  top: 6px; right: 6px;
  display: flex; gap: 6px;
  z-index: 20;
  opacity: 0;
  transition: opacity .15s;
}
.mini:hover .card-actions { opacity: 1; }

.icon-btn {
  width: 20px; height: 20px;
  border-radius: 6px;
  padding: 0;
  border: 1px solid #2a2a2a;
  background: rgba(255,255,255,.06);
  color: #cfcfcf;
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn:hover { background: rgba(255,255,255,.10); }

/* 52週高値バッジ */
.badge-high {
  position: absolute;
  top: 6px; left: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(245,158,11,.16);
  border: 1px solid var(--warn);
  color: var(--warn);
  animation: badge-pop .9s ease-out 1;
}
@keyframes badge-pop {
  from { transform: scale(.92); opacity: .2 }
  to { transform: scale(1); opacity: 1 }
}
/* カード（JP/LWC/TV含む）を完全スクエアに */
.mini,
.mini .title,
.mini .chart,
.cat-col,
.cat-col > header {
  border-radius: 0 !important;
}

/* === TV右上ロゴの自然マスク === */
.mini.tv .chart::after {
  content: "";
  position: absolute;
  top: var(--tv-mask-top, 9px);     /* 位置は変数で調整できるように */
  right: var(--tv-mask-right, 2px);
  width: var(--tv-mask-w, 28px);    /* 横幅 */
  height: var(--tv-mask-h, 28px);   /* 高さ */
  background:#202020;
  pointer-events: none;             /* クリック透過 */
  z-index: 6;                       /* ロゴより上に */
}

/* ===== cat-controls ボタン調整 ===== */
.cat-controls button.btn {
  background: transparent;              /* 通常は透明背景 */
  border: 1px solid var(--accent);      /* アクセントで枠線 */
  color: var(--accent);                 /* テキストもアクセント色 */
  font-weight: 600;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.1s ease;
}

/* hover: 背景がアクセント色に変わり、文字を黒にして視認性UP */
.cat-controls button.btn:hover:not(:disabled) {
  background: var(--accent);
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 212, 191, 0.35);
}

/* active: 押し込み表現 */
.cat-controls button.btn:active:not(:disabled) {
  background: #22b3a7;  /* 少し暗いティール */
  color: #000;
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* focus: アクセントのリングを出す */
.cat-controls button.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 入力幅：プレースホルダが見えるように */
.cat-controls input {
  min-width: 240px;   /* 200→240 に少し拡張 */
  flex: 1;
}

/* ラベルのトーン統一（表示範囲） */
.cat-controls label.control-label {
  font-size: 14px;
  color: var(--muted);
  margin-left: 8px;
  margin-right: 2px;
  user-select: none;
}

/* カテゴリ見出し */
.cat-col > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-top: 16px;
  background: #151a20;
  border: 1px solid #222;
  border-radius: 6px 6px 0 0;
}

/* 見出しテキスト */
.cat-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

/* アイコンを自動で追加 */
.cat-title::before {
  content: "📂";
  font-size: 15px;
  opacity: 0.85;
}

/* 削除ボタン（アイコン版） */
.delete-btn {
  background: #151a20;
  font-size: 16px;   /* ← アイコンが小さくならないよう拡大 */
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.delete-btn:hover {
  background: var(--bad);
}


/* ===== カテゴリ名を見出し風に ===== */
.cat-head .cat-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* アイコンを追加 */
.cat-head .cat-name::before {
  content: "📂";
  font-size: 15px;
  opacity: 0.85;
}
