/* ==========================================================
   screens.css — ホーム / 新規トレード / データ / 設定 の見た目
   ========================================================== */

/* ---------- ホーム ---------- */
.home-section-compact {
    padding: 10px 12px;
    margin-bottom: 8px;
}

/* 今後の重要イベント: 指標2件分の高さで固定(1件でも同じ大きさ)し、3件目以降は中でスクロール(高さは home.js の fitMajorEventHeight が測って決める) */
.home-scroll-list {
    display: flex; flex-direction: column; gap: 4px;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.major-card { flex-shrink: 0; }

.indicator-item {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-glass);
    border-radius: 10px; padding: 7px 9px; font-size: 0.72rem; margin-bottom: 4px;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.indicator-stars { color: #facc15; font-size: 0.65rem; margin-left: 4px; text-shadow: 0 0 6px rgba(250, 204, 21, 0.5); }
.indicator-flag { font-size: 0.95rem; margin-right: 6px; display: inline-flex; align-items: center; vertical-align: middle; }

/* ---------- 新規トレード ---------- */
/* ホイールの配置: 1行目=左から 通貨ペア / SL / 決済、2行目=通貨ペアの下に Lot。カードの幅は3列とも同じ */
.wheels-horizontal-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}
.picker-box.wheel-pair { grid-column: 1; grid-row: 1; }
.picker-box.wheel-sl   { grid-column: 2; grid-row: 1; }
.picker-box.wheel-pips { grid-column: 3; grid-row: 1; }
.picker-box.wheel-lot  { grid-column: 1; grid-row: 2; }
.picker-box {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-top-color: rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}
.picker-label {
    font-size: 0.68rem;
    color: var(--text-sub);
    font-weight: 600;
    margin-bottom: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.picker-container {
    position: relative;
    height: 80px;
    width: 100%;
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    overflow: hidden;
    touch-action: pan-y;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.8);
}
.picker-selection-overlay {
    position: absolute;
    top: 25px; left: 0; width: 100%; height: 30px;
    background: var(--band-bg);
    border-top: 1px solid var(--band-bd);
    border-bottom: 1px solid var(--band-bd);
    pointer-events: none; z-index: 2;
}
.picker-wheel { position: absolute; width: 100%; top: 25px; left: 0; will-change: transform; }
.picker-item {
    height: 30px; line-height: 30px; text-align: center; font-size: 0.8rem;
    font-weight: 600; color: var(--text-sub); transition: color 0.12s, text-shadow 0.12s;
}
.picker-item.selected {
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 700;
    text-shadow: var(--glow-text);
}

/* SL・決済pips: 整数部と小数部の2連ホイール */
.picker-dual { display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; }
.picker-dual .picker-container { flex: 1 1 0; min-width: 0; }
.picker-dual .picker-container:last-child { flex: 0.8 1 0; }
.picker-dot { color: var(--text-sub); font-weight: 700; font-size: 0.9rem; }

/* ---------- データ(履歴/年次/通貨別/カレンダー) ---------- */
/* 部品 folder-tab(データ画面の4タブ。表示面は .sub-view / .sub-view.active) */
.fold { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.fts { flex: none; display: flex; gap: 2px; margin-bottom: -1px; position: relative; z-index: 1; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.fts::-webkit-scrollbar { display: none; }
.ft { flex: 1 0 0; min-width: max-content; white-space: nowrap; text-align: center; font-size: 0.68rem; font-weight: 600; line-height: normal; padding: 8px 10px; color: var(--text-sub); background: #161616; border: 1px solid var(--border-glass); border-bottom: 0; border-radius: 12px 12px 0 0; }
.ft.on { color: #ffffff; text-shadow: var(--glow-text); border-color: rgba(255, 255, 255, 0.45); background: #000000; border-bottom: 1px solid #000000; }
.fc { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 10px; border: 1px solid var(--border-glass); border-radius: 0 0 16px 16px; background: #000000; }
.sub-view { display: none; }
.sub-view.active { display: block; }

.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.8rem; font-weight: bold; }
.cal-nav button { background: rgba(255, 255, 255, 0.12); border: 1px solid var(--border-glass); color: var(--text-main); padding: 5px 12px; border-radius: 10px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; font-size: 0.68rem; }
.cal-header { color: var(--text-sub); padding: 2px 0; font-weight: bold; font-size: 0.6rem; }
.cal-cell { background: rgba(15, 15, 22, 0.7); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 4px 1px; min-height: 48px; display: flex; flex-direction: column; justify-content: space-between; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.cal-cell.weekend { opacity: 0.35; background: rgba(0, 0, 0, 0.7); }
.cal-cell.has-data { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.08); }
.cal-date { color: var(--text-sub); font-size: 0.6rem; }
.cal-profit { font-size: 0.52rem; font-weight: bold; white-space: nowrap; }

/* ---------- 設定 ---------- */
.settings-sub-tab {
    background: rgba(255, 255, 255, 0.08);
    color: #cccccc;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    text-align: center;
    padding: 7px 4px;
    font-size: 0.68rem;
    font-weight: 600;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.settings-sub-tab.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: #ffffff;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-shadow: var(--glow-text);
    box-shadow: 0 0 12px rgba(255,255,255,0.2);
}

.color-picker-group {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 0.72rem; color: var(--text-sub);
}
.color-picker-input {
    width: 36px; height: 28px; padding: 0; border: none; border-radius: 6px; cursor: pointer; background: transparent;
}

/* ---------- 設定(一覧 + 下から出る詳細シート) ---------- */
/* 一覧 */
.set-stats { display: flex; gap: 6px; }
.set-stat { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; padding: 6px 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-subtle); }
.set-stat span { font-size: 0.58rem; color: var(--text-sub); opacity: 0.8; }
.set-stat b { font-size: 0.66rem; font-weight: 600; color: var(--text-sub); }
.set-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 4px; background: var(--success); box-shadow: 0 0 6px var(--success); }
.set-dot.off { background: var(--text-sub); box-shadow: none; }
.set-group-title { font-size: 0.7rem; font-weight: 700; color: var(--text-sub); letter-spacing: 0.06em; margin: 14px 4px 6px; }
.set-list, .set-card { padding: 4px 14px; margin-bottom: 12px; }
.set-card.set-pad { padding: 14px; }
.set-nav-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: opacity 0.15s ease; }
.set-nav-row:last-child { border-bottom: none; }
.set-nav-row:active { opacity: 0.6; }
.set-nav-t { flex: 1; font-size: 0.85rem; font-weight: 600; }
.set-nav-t small { display: block; font-size: 0.64rem; color: var(--text-sub); font-weight: 400; margin-top: 2px; }
.set-chev { color: var(--text-sub); font-size: 1.1rem; }

/* シート(.container の外。ヘッダー・ナビ(z-index 1000)より上、モーダル(2000)・トースト(3000)より下) */

/* シートの中身 */
.set-h { font-size: 0.7rem; font-weight: 700; color: var(--text-sub); letter-spacing: 0.06em; margin: 14px 4px 6px; display: flex; justify-content: space-between; align-items: center; }
.set-note { font-size: 0.66rem; color: var(--text-sub); line-height: 1.55; padding: 2px 0 10px; }
.set-sub-label { font-size: 0.68rem; color: var(--text-sub); margin: 4px 0 6px; }
.set-st { font-size: 0.66rem; color: var(--text-sub); word-break: break-all; margin: 4px 0 8px; }
.set-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border-subtle); font-size: 0.8rem; }
.set-row:last-child, .set-col:last-child { border-bottom: none; }
.set-row label { flex: 1; display: block; font-size: 0.8rem; color: var(--text-main); margin: 0; }
.set-row label small { display: block; font-size: 0.62rem; color: var(--text-sub); margin-top: 2px; }
.set-row input[type=number] { width: 104px; flex: none; text-align: right; }
.set-row select { width: auto; min-width: 76px; text-align: right; }
.set-row input[type=color] { width: 38px; height: 30px; padding: 0; border: none; background: none; }
.set-col { padding: 11px 0; border-bottom: 1px solid var(--border-subtle); }
.set-col > label { display: block; font-size: 0.72rem; color: var(--text-sub); margin-bottom: 5px; }
.set-tag { white-space: nowrap; font-size: 0.58rem; padding: 1px 6px; border-radius: 8px; border: 1px solid var(--border-glass); color: var(--text-sub); margin-left: 6px; vertical-align: 1px; }
.set-btn-row { display: flex; gap: 8px; }
.set-btn-row .btn { flex: 1; margin: 6px 0; }
.set-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 8px; }

/* 切り替えスイッチ。実体は非表示の <select>(id・値・onchange は従来のまま)で、スイッチはその値を切り替えるだけ(ui.js) */
.set-sw-sel { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.set-sw { position: relative; width: 46px; height: 28px; border-radius: 14px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border-glass); cursor: pointer; flex: none; transition: background 0.2s, border-color 0.2s, box-shadow 0.2s; }
.set-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #6b7280; transition: transform 0.2s, background 0.2s, box-shadow 0.2s; }
.set-sw.on { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.55); box-shadow: 0 0 6px rgba(255, 255, 255, 0.25); }
.set-sw.on::after { transform: translateX(18px); background: #ffffff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.7); }

/* シートの中: カードのぼかしは外す(背景が不透明に近く効果が見えない。入力欄のカーソル位置ずれの予防) */

/* 見えない実体(<select> / <textarea>)。値の保持と change イベントのために DOM に残す */
.set-hid-sel { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

.set-h-sub { font-weight: 400; font-size: 0.62rem; color: var(--text-sub); letter-spacing: 0; }
.set-hint { font-size: 0.64rem; color: var(--text-sub); line-height: 1.55; margin-top: 8px; }
.set-mini { flex: none; }

/* チップ(国・通貨ペア・キーワードの選択) */
.set-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; font-size: 0.72rem; font-weight: 600; border-radius: 16px; cursor: pointer; color: var(--text-sub); background: rgba(255, 255, 255, 0.07); border: 1px solid var(--border-glass); transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; touch-action: manipulation; }
.set-chip:active { transform: scale(0.94); }
.set-chip.on { background: #ffffff; color: #000000; font-weight: 700; border-color: #ffffff; box-shadow: 0 0 10px rgba(255, 255, 255, 0.4); }
.set-chip.on::before { content: "✓"; font-size: 0.68rem; }
.set-chip.kw { background: rgba(255, 255, 255, 0.12); color: var(--text-main); }
.set-chip.kw::before { content: none; }
.set-chip.kw i { font-style: normal; font-size: 0.8rem; opacity: 0.6; margin-left: 2px; }
.set-chip.suggest { border-style: dashed; background: transparent; font-weight: 500; }
.set-chip.suggest::before { content: "+"; font-size: 0.8rem; }

/* キーワードの追加欄 */
.set-add { display: flex; gap: 8px; align-items: stretch; margin-top: 4px; }
.set-add input { flex: 1; min-width: 0; }
.set-add-btn { flex: none; }

/* 入出金の一覧(設定 > 接続・データ)。色は変数(買い=--success / 売り=--danger)を使う */
.set-cf-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-subtle); }
.set-cf-item:last-child { border-bottom: none; }
.set-cf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 0.72rem; color: var(--text-sub); }
.set-cf-main b { font-size: 0.82rem; font-weight: 700; }
.set-cf-main small { font-size: 0.62rem; color: var(--text-sub); word-break: break-all; }
.set-cf-in { color: var(--success); }
.set-cf-out { color: var(--danger); }

/* EMA設定の行(期間・色・透過率を1行に並べる)。スマホで折り返さないよう、入力欄を細くする */
.set-row.set-ema { gap: 8px; }
.set-row.set-ema input[type=number] { width: 58px; padding: 0 6px; }   /* 幅が狭いので、左右の余白を詰める(3桁が切れないように) */
.set-row.set-ema select { min-width: 62px; padding-left: 6px; padding-right: 6px; }

/* EMA設定の見出し行(各列の意味を小さい文字で示す。幅は下の行の入力欄と同じにして縦をそろえる) */
.set-ema-head { display: flex; align-items: flex-end; gap: 8px; padding: 2px 0 6px; border-bottom: 1px solid var(--border-subtle); font-size: 0.6rem; color: var(--text-sub); }
.set-ema-head span { flex: none; text-align: center; white-space: nowrap; }
.set-ema-head .set-ema-h-name { flex: 1; text-align: left; }
.set-ema-head .set-ema-h-p { width: 58px; }
.set-ema-head .set-ema-h-c { width: 38px; }
.set-ema-head .set-ema-h-t { width: 62px; }
.set-row.set-ema select { width: 62px; min-width: 62px; }

/* ---------- クラウドバックアップの警告バー(全タブ共通。ヘッダーの下に、小さく重ねる。シート1500・モーダル2000・トースト3000より下) ---------- */
/* 設定一覧の帯が4つになったので、幅の狭い端末では余白を詰める */
@media (max-width: 380px) { .set-stat { padding: 6px 2px; gap: 3px; } }
