﻿/* ============================================
   推シツジ - App Styles
   推し色テーマ: --oshi でアプリ全体の色が変わる
   ============================================ */
/* パターンA「ポップ&キュート」基準・ライトテーマ固定
   （ダークモードは将来トグルとして再導入予定） */
:root {
  --oshi: #ff5c8a;
  --oshi-soft: #ff5c8a1a;
  --oshi-mid: #ff5c8a33;
  --oshi-light: color-mix(in srgb, var(--oshi) 62%, #ffffff);
  --bg: #fdf7f9;
  --card: #ffffff;
  --text: #3a2e38;
  --text-sub: color-mix(in srgb, var(--oshi) 30%, #9a8a94);
  --line: color-mix(in srgb, var(--oshi) 9%, #f1eaee);
  --danger: #e5484d;
  --ok: #30a46c;
  --radius: 16px;
  --shadow: 0 2px 10px color-mix(in srgb, var(--oshi) 13%, transparent);
  --tab-h: 62px;
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overscroll-behavior-y: none;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea {
  font-family: inherit; font-size: 16px; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--oshi); }
img { max-width: 100%; display: block; }

#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }

/* ===== ヘッダー ===== */
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg, var(--oshi), var(--oshi-light));
  color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 14px;
  border-radius: 0 0 22px 22px;
  box-shadow: var(--shadow);
}
.header-oshi { display: flex; align-items: center; gap: 12px; }
.oshi-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; overflow: hidden; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.6);
}
.oshi-avatar img { width: 100%; height: 100%; object-fit: cover; }
.header-title { font-weight: 700; font-size: 17px; }
.header-sub { font-size: 12px; opacity: .85; }

/* ===== メイン ===== */
#main { padding: 16px 16px calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 84px); }
.section-title {
  font-size: 14px; font-weight: 700; color: var(--text-sub);
  margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between;
}
.section-title:first-child { margin-top: 4px; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px;
}

/* ===== 執事ひつじ「シツジ」 ===== */
.ai-greeting { font-size: 14px; padding: 12px 14px; }
.shitsuji-row { display: flex; gap: 10px; align-items: flex-start; }
.shitsuji-avatar {
  width: 54px; height: 54px; flex-shrink: 0;
  border-radius: 50%; background: var(--oshi-soft);
  border: 2px solid var(--oshi-mid); overflow: hidden;
}
.shitsuji-avatar svg { width: 100%; height: 100%; transform: scale(1.08) translateY(3%); }
.shitsuji-bubble {
  flex: 1; min-width: 0; background: var(--bg);
  border-radius: 4px 14px 14px 14px; padding: 9px 12px 10px;
}
.shitsuji-name { font-size: 12.5px; font-weight: 700; color: var(--oshi); margin-bottom: 3px; }
.shitsuji-role {
  font-size: 9px; background: var(--oshi-soft); color: var(--oshi);
  border-radius: 99px; padding: 2px 8px; font-weight: 600; margin-left: 6px; vertical-align: 1px;
}
.shitsuji-text { font-size: 13px; line-height: 1.7; }
.shitsuji-text b { color: var(--oshi); }

.deadline-card { display: flex; align-items: center; gap: 12px; }
.deadline-count {
  min-width: 64px; text-align: center; border-radius: 12px;
  background: var(--oshi); color: #fff;
  padding: 8px 6px; font-weight: 700; flex-shrink: 0;
}
.deadline-count .num { font-size: 22px; line-height: 1.1; display: block; }
.deadline-count .unit { font-size: 10px; }
.deadline-count.urgent { background: var(--danger); color: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.deadline-info { flex: 1; min-width: 0; }
.deadline-title { font-weight: 600; font-size: 14px; }
.deadline-date { font-size: 12px; color: var(--text-sub); }

.event-card { display: flex; gap: 12px; align-items: flex-start; }
.event-date-badge {
  min-width: 52px; text-align: center; background: var(--oshi-soft);
  border-radius: 12px; padding: 6px 4px; flex-shrink: 0;
}
.event-date-badge .month { font-size: 10px; color: var(--oshi); font-weight: 700; }
.event-date-badge .day { font-size: 20px; font-weight: 700; color: var(--oshi); line-height: 1.1; }
.event-info { flex: 1; min-width: 0; }
.event-title { font-weight: 600; font-size: 14px; }
.event-meta { font-size: 12px; color: var(--text-sub); }
.event-tags { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.tag {
  font-size: 10px; padding: 2px 8px; border-radius: 99px;
  background: var(--oshi-soft); color: var(--oshi); font-weight: 600;
}
.card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.icon-btn { font-size: 15px; padding: 4px 6px; opacity: .55; border-radius: 8px; }
.icon-btn:active { background: var(--oshi-soft); }
/* 推しカードの操作ボタン（視認性重視のチップ型） */
.oshi-act {
  opacity: 1; font-size: 15px;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 6px 9px; display: inline-flex; align-items: center; gap: 3px;
}
.oshi-act small { font-size: 10px; font-weight: 700; color: var(--text-sub); }
.oshi-act:active { border-color: var(--oshi); background: var(--oshi-soft); }

.news-card { display: flex; gap: 10px; align-items: flex-start; }
.news-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.news-body { flex: 1; min-width: 0; }
.news-title { font-size: 13px; font-weight: 600; }
.news-meta { font-size: 11px; color: var(--text-sub); }
.news-card.unread { border-left: 3px solid var(--oshi); }

/* ===== グッズ ===== */
.goods-stats { display: flex; text-align: center; padding: 16px 8px; }
.goods-stats .stat { flex: 1; }
.goods-stats .stat + .stat { border-left: 1px solid var(--line); }
.stat-value { font-size: 19px; font-weight: 700; color: var(--oshi); }
.stat-label { font-size: 11px; color: var(--text-sub); }
.stat-diff-up { color: var(--ok); }
.stat-diff-down { color: var(--danger); }

.goods-filter { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.goods-filter::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 99px;
  background: var(--card); color: var(--text-sub);
  border: 1.5px solid var(--line);
}
.filter-chip.active { background: var(--oshi); color: #fff; border-color: var(--oshi); }

.goods-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.goods-item {
  background: var(--card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); text-align: left;
}
.goods-photo { aspect-ratio: 1; background: var(--oshi-soft); display: flex; align-items: center; justify-content: center; font-size: 38px; overflow: hidden; }
.goods-photo img { width: 100%; height: 100%; object-fit: cover; }
.goods-detail { padding: 8px 10px 10px; }
.goods-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goods-cat { font-size: 10px; color: var(--text-sub); }
.goods-prices { display: flex; justify-content: space-between; font-size: 11px; margin-top: 4px; }
.goods-price-buy { color: var(--text-sub); }
.goods-price-market { font-weight: 700; }

/* ===== 遠征 ===== */
.travel-card .travel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.travel-days {
  background: var(--oshi); color: #fff; border-radius: 10px;
  font-size: 11px; font-weight: 700; padding: 4px 10px; flex-shrink: 0;
}
.travel-title { font-weight: 700; font-size: 14px; flex: 1; }
.travel-venue { font-size: 12px; color: var(--text-sub); margin-bottom: 10px; }
.travel-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.travel-link {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: 12px; padding: 10px;
  font-size: 12px; font-weight: 600; text-decoration: none; color: var(--text);
  border: 1.5px solid var(--line);
}
.travel-link:active { border-color: var(--oshi); }
.travel-link .tl-icon { font-size: 18px; }
.travel-tip {
  margin-top: 10px; font-size: 12px; color: var(--text-sub);
  background: var(--oshi-soft); border-radius: 10px; padding: 8px 12px;
}

/* ===== アルバム ===== */
.album-timeline { position: relative; padding-left: 24px; }
.album-timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: var(--oshi-mid); border-radius: 2px;
}
.album-entry { position: relative; margin-bottom: 18px; }
.album-entry::before {
  content: ""; position: absolute; left: -22px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--oshi); border: 2.5px solid var(--bg);
}
.album-date { font-size: 11px; font-weight: 700; color: var(--oshi); margin-bottom: 4px; }
.album-card { padding: 12px 14px; }
.album-title { font-weight: 700; font-size: 14px; }
.album-note { font-size: 13px; color: var(--text); margin-top: 6px; white-space: pre-wrap; }
.album-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.album-photos img { border-radius: 10px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.album-kind { font-size: 10px; }

/* ===== 推し設定 ===== */
.oshi-card { display: flex; align-items: center; gap: 12px; }
.oshi-card .oshi-color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.oshi-card .oshi-info { flex: 1; min-width: 0; }
.oshi-card .oshi-name { font-weight: 700; font-size: 15px; }
.oshi-card .oshi-genre { font-size: 12px; color: var(--text-sub); }
.oshi-card.selected { border: 2px solid var(--oshi); }
.oshi-badge { font-size: 10px; background: var(--oshi); color: #fff; border-radius: 99px; padding: 2px 8px; font-weight: 700; }

.settings-card { display: flex; flex-direction: column; gap: 10px; }
.app-version { text-align: center; font-size: 11px; color: var(--text-sub); margin-top: 20px; }

/* ===== 共通ボタン ===== */
.btn-primary {
  display: block; width: 100%; text-align: center;
  background: var(--oshi); color: #fff; font-weight: 700; font-size: 15px;
  padding: 13px; border-radius: 12px; margin-top: 14px;
}
.btn-primary:active { opacity: .85; }
.btn-secondary {
  display: block; width: 100%; text-align: center;
  background: var(--bg); color: var(--text); font-weight: 600; font-size: 14px;
  padding: 12px; border-radius: 12px; border: 1.5px solid var(--line);
}
.btn-add-inline {
  display: block; width: 100%; text-align: center;
  border: 2px dashed var(--oshi-mid); color: var(--oshi);
  font-weight: 600; font-size: 13px; padding: 12px; border-radius: var(--radius);
  background: transparent;
}
.btn-mini {
  font-size: 11px; font-weight: 600; color: var(--oshi);
  background: var(--oshi-soft); border-radius: 99px; padding: 4px 12px;
}
.btn-import-label { cursor: pointer; }

/* ===== FAB ===== */
.fab {
  position: fixed; right: max(16px, calc(50vw - 264px));
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 16px);
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--oshi); color: #fff; font-size: 26px;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--oshi) 50%, transparent);
  z-index: 30; transition: transform .15s;
}
.fab:active { transform: scale(.92); }

/* ===== タブバー ===== */
.tab-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 30;
  display: flex; background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
}
.tab-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; color: var(--text-sub);
  font-size: 10px; padding-top: 6px;
}
.tab-btn .tab-icon { font-size: 20px; filter: grayscale(1); opacity: .6; transition: all .15s; }
.tab-btn.active { color: var(--oshi); font-weight: 700; }
.tab-btn.active .tab-icon { filter: none; opacity: 1; transform: scale(1.12); }

/* ===== モーダル ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 10, 25, .5);
  z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--card); width: 100%; max-width: 560px;
  border-radius: 22px 22px 0 0; max-height: 88dvh;
  display: flex; flex-direction: column;
  animation: slideUp .25s cubic-bezier(.2, .9, .3, 1);
}
@keyframes slideUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 8px; flex-shrink: 0;
}
.modal-title { font-weight: 700; font-size: 16px; }
.modal-close { font-size: 16px; color: var(--text-sub); padding: 6px; }
.modal-body { padding: 8px 18px calc(24px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-sub); margin-bottom: 5px; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }

.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid transparent; flex-shrink: 0;
}
.color-swatch.selected { border-color: var(--text); transform: scale(1.1); }

.photo-drop {
  border: 2px dashed var(--oshi-mid); border-radius: var(--radius);
  padding: 20px; text-align: center; color: var(--oshi);
  font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--oshi-soft);
}
.photo-preview { position: relative; margin-top: 10px; }
.photo-preview img { border-radius: 12px; max-height: 180px; object-fit: contain; margin: 0 auto; }

.ai-recognizing {
  display: flex; align-items: center; gap: 10px;
  background: var(--oshi-soft); border-radius: 12px; padding: 12px;
  font-size: 13px; color: var(--oshi); font-weight: 600; margin-top: 10px;
}
.ai-spinner {
  width: 18px; height: 18px; border: 2.5px solid var(--oshi-mid);
  border-top-color: var(--oshi); border-radius: 50%;
  animation: spin .8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-result {
  background: var(--oshi-soft); border-radius: 12px; padding: 12px;
  font-size: 12px; margin-top: 10px;
}
.ai-result .ai-result-head { font-weight: 700; color: var(--oshi); margin-bottom: 4px; }

/* ===== 当落ステータス ===== */
.st-chip { font-size: 10px; padding: 2px 8px; border-radius: 99px; font-weight: 700; }
.st-applied { background: #2f6fed1a; color: #2f6fed; }
.st-won { background: #30a46c1a; color: #30a46c; }
.st-lost { background: #8a809222; color: #8a8092; }
.st-paid { background: var(--oshi-soft); color: var(--oshi); }
.win-rate { font-size: 10px; background: var(--oshi-soft); color: var(--oshi); border-radius: 99px; padding: 2px 10px; font-weight: 700; }

/* ===== 推しリンク集 ===== */
.link-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.link-chip {
  font-size: 12px; font-weight: 600; background: var(--card);
  border: 1.5px solid var(--line); border-radius: 99px;
  padding: 6px 14px; text-decoration: none; color: var(--text);
}
.link-chip:active { border-color: var(--oshi); color: var(--oshi); }

/* ===== 記念日 ===== */
.anniv-row { display: flex; gap: 10px; margin-bottom: 12px; }
.anniv-card {
  flex: 1; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 12px; text-align: center;
}
.anniv-num { font-size: 17px; font-weight: 700; color: var(--oshi); }
.anniv-label { font-size: 10px; color: var(--text-sub); }

/* ===== 支出 ===== */
.spend-card { width: 100%; text-align: left; display: block; }
.spend-total { font-size: 21px; font-weight: 700; color: var(--oshi); }
.spend-budget { font-size: 12px; color: var(--text-sub); margin-left: 6px; }
.spend-bar { height: 8px; background: var(--oshi-soft); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.spend-bar-fill { height: 100%; background: var(--oshi); border-radius: 99px; transition: width .3s; }
.spend-bar-fill.over { background: var(--danger); }
.spend-hint { font-size: 10px; color: var(--text-sub); margin-top: 6px; }
.cat-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 7px; }
.cat-name { width: 64px; flex-shrink: 0; }
.cat-bar { flex: 1; height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.cat-bar-fill { height: 100%; background: var(--oshi); border-radius: 99px; }
.cat-amt { width: 74px; text-align: right; font-weight: 700; flex-shrink: 0; }
.exp-item {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; padding: 8px 0; border-bottom: 1px solid var(--line);
}

/* ===== アルバム拡張 ===== */
.album-meta { font-size: 11px; color: var(--text-sub); margin-top: 5px; }
.setlist { margin-top: 8px; font-size: 12px; }
.setlist summary { cursor: pointer; color: var(--oshi); font-weight: 600; list-style: none; }
.setlist summary::before { content: "▸ "; }
.setlist[open] summary::before { content: "▾ "; }
.setlist div { white-space: pre-wrap; margin-top: 6px; color: var(--text-sub); }

/* ===== フォーム区切り ===== */
.form-h {
  font-size: 12px; font-weight: 700; color: var(--oshi);
  margin: 16px 0 10px; border-top: 1.5px dashed var(--line); padding-top: 14px;
}
.link-row { margin-bottom: 8px; }

/* ===== 現場ツール ===== */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tool-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 8px 12px; text-align: center; font-size: 12px; font-weight: 700;
  color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.tool-card small { font-size: 9px; font-weight: 400; color: var(--text-sub); }
.tool-card .tool-icon { font-size: 28px; }
.tool-card:active { transform: scale(.96); }

/* ペンライト・LED 共通オーバーレイ */
.penlight-overlay, .led-overlay {
  position: fixed; inset: 0; z-index: 70;
  transition: background .25s;
}
.ol-close {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 2;
  background: rgba(0,0,0,.35); color: #fff; font-size: 13px; font-weight: 700;
  padding: 8px 16px; border-radius: 99px; backdrop-filter: blur(4px);
}
.pl-swatches {
  position: absolute; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  background: rgba(0,0,0,.25); border-radius: 20px; padding: 10px 14px; max-width: 92vw;
  backdrop-filter: blur(4px);
}
.pl-sw { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.8); }

.led-overlay { background: #000; overflow: hidden; }
.led-viewport { position: absolute; inset: 0; display: flex; align-items: center; overflow: hidden; }
.led-viewport.rot {
  transform: rotate(90deg); transform-origin: center;
  width: 100vh; height: 100vw;
  top: 50%; left: 50%; margin-left: -50vh; margin-top: -50vw; inset: auto;
}
.led-text {
  font-size: min(52vh, 60vw); font-weight: 900; white-space: nowrap; line-height: 1;
  animation: ledScroll linear infinite;
  font-family: "M PLUS Rounded 1c", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}
.led-viewport.rot .led-text { font-size: min(52vw, 60vh); }
@keyframes ledScroll {
  from { transform: translateX(var(--led-from, 100vw)); }
  to { transform: translateX(var(--led-to, -100%)); }
}

/* うちわ */
.color-swatch.sm { width: 30px; height: 30px; }
#uchiwaCanvas { margin-bottom: 4px; }
.font-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.font-row::-webkit-scrollbar { display: none; }
.font-chip {
  flex-shrink: 0; min-width: 64px; text-align: center;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 8px 10px 6px; font-size: 20px; line-height: 1.1; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.font-chip small { font-size: 9px; color: var(--text-sub); font-family: "Hiragino Sans", "Yu Gothic UI", sans-serif; font-weight: 600; }
.font-chip.selected { border-color: var(--oshi); background: var(--oshi-soft); }
.font-chip.selected small { color: var(--oshi); }

/* ===== 譲・求リスト ===== */
.trade-group { padding: 0; overflow: hidden; }
.trade-head { font-size: 12px; font-weight: 700; padding: 10px 14px; color: #fff; }
.trade-head.give { background: var(--oshi); }
.trade-head.want { background: color-mix(in srgb, var(--oshi) 45%, #7b5cff); }
.trade-item {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.trade-item:last-child { border-bottom: none; }
.trade-item small { color: var(--text-sub); font-size: 11px; }

/* ===== 推し貯金 ===== */
.quick-row { display: flex; gap: 8px; }
.quick-row .btn-secondary { font-size: 13px; padding: 10px 4px; }

/* ===== リワード広告 ===== */
.ad-overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(15, 8, 15, .92);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(4px);
}
.ad-box {
  background: var(--card); border-radius: 20px; padding: 20px;
  width: 100%; max-width: 360px; text-align: center;
}
.ad-label {
  display: inline-block; font-size: 10px; font-weight: 700; color: var(--text-sub);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 8px; margin-bottom: 12px;
}
.ad-mock {
  background: #1a1420; color: #fff; border-radius: 14px;
  padding: 48px 16px; font-size: 40px; margin-bottom: 16px;
}
.ad-mock small { font-size: 11px; color: #9d93a6; display: block; margin-top: 10px; line-height: 1.6; }
.ad-btn:disabled { opacity: .5; }

/* グラデ・カスタムスワッチ（プレミアム） */
.color-swatch.grad {
  background: linear-gradient(135deg, #ff2d95, #ff8c22, #ffe600);
  font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.color-swatch.custom {
  background: conic-gradient(#ff2d95, #ff8c22, #ffe600, #aaff00, #00cfff, #7b5cff, #ff2d95);
  font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.crown-note { font-size: 10px; color: var(--oshi); font-weight: 700; }

/* 先行登録フォーム */
.check-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px;
  cursor: pointer;
}
.check-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--oshi); flex-shrink: 0; }

/* 情報源リスト */
.src-item {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 9px 0; border-bottom: 1px solid var(--line);
}
.src-item:last-of-type { border-bottom: none; }
.src-badge { font-size: 10px; font-weight: 700; border-radius: 99px; padding: 3px 10px; }
.src-badge.on { background: #30a46c1a; color: #30a46c; }
.src-badge.off { background: var(--bg); color: var(--text-sub); }
.src-note { font-size: 10px; color: var(--text-sub); margin-top: 10px; line-height: 1.6; }
.data-note {
  font-size: 12px; color: var(--text-sub); line-height: 1.75;
  background: var(--bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;
}
.data-note b { color: var(--text); }

/* Wikidata自動入力 */
.wd-loading { font-size: 12px; color: var(--text-sub); padding: 8px 2px; }
.wd-cand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; margin-top: 6px;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; color: var(--text);
}
.wd-cand:active { border-color: var(--oshi); }
.wd-cand small { font-size: 11px; color: var(--text-sub); }
.wd-done {
  font-size: 12px; font-weight: 600; color: var(--ok);
  background: #30a46c14; border-radius: 10px; padding: 10px 12px; margin-top: 6px;
}
.wd-done small { font-weight: 400; color: var(--text-sub); margin-left: 4px; }

/* ===== オンボーディング ===== */
.onb-overlay {
  position: fixed; inset: 0; z-index: 95;
  background: linear-gradient(160deg, #fff1f5, #fdf7f9 45%, #ffe9f0);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
}
.onb-card {
  width: 100%; max-width: 360px; text-align: center;
  animation: onbIn .35s ease;
}
@keyframes onbIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.onb-sheep { margin: 0 auto 6px; animation: sheepBob 2.4s ease-in-out infinite; }
.onb-sheep svg { width: 100%; height: 100%; }
@keyframes sheepBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.onb-title { font-size: 22px; font-weight: 700; color: var(--text); margin: 8px 0 10px; }
.onb-title.sm { font-size: 18px; }
.onb-text { font-size: 14px; line-height: 1.85; color: var(--text-sub); }
.onb-text b { color: var(--oshi); }
.onb-btn { margin-top: 22px; font-size: 15px; }
.onb-form { text-align: left; margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.onb-form input, .onb-form select { background: #fff; }
.onb-hint { font-size: 11px; color: var(--text-sub); }
.onb-icon { font-size: 54px; margin: 18px 0 2px; }
.onb-bubble-row { display: flex; gap: 10px; align-items: flex-start; text-align: left; }
.onb-bubble { background: #fff; box-shadow: var(--shadow); flex: 1; border-radius: 4px 14px 14px 14px; padding: 10px 12px; }
.onb-dots { display: flex; gap: 7px; justify-content: center; margin-top: 16px; }
.onb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--oshi-mid); transition: background .2s; }
.onb-dot.on { background: var(--oshi); }

/* ===== 空状態 ===== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-sub); font-size: 13px; }
.empty-icon { font-size: 44px; margin-bottom: 10px; }

/* ===== トースト ===== */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 80px);
  background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 600; padding: 10px 20px;
  border-radius: 99px; z-index: 60; box-shadow: var(--shadow);
  animation: toastIn .2s;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }

/* FABメニュー */
.fab-menu {
  position: fixed; right: max(16px, calc(50vw - 264px));
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 80px);
  z-index: 40; display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.fab-menu-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 99px;
  padding: 10px 16px; font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow); animation: slideUp .2s;
}
