/* ============================================
   フレカ 共通スタイル
   edit / view 両方で使用
============================================ */
:root {
  --pink:    #f9a8c9;
  --pink-bg: #fde8f3;
  --accent:  #f9b8d4;
  --accent-sub: #c9b8f0;
  --accent-bg1: #fff5fb;
  --accent-bg2: #f5f0ff;
  --accent-border: #f8bbd0;
  --accent-card-bg1: #fde8f3;
  --accent-card-bg2: #e8e4f8;
  --accent-soft-bg: #fdf4fa;
  --text:    #5c4a6e;
  --text-sub:#c4a8c4;
  --border:  #f5ddef;
  --bg:      #fef5fb;
  --white:   #ffffff;
  --radius:  16px;
  --green:   #6dbe8d;
  --red:     #e06f6f;
  --footer-h:        100px;  /* ★ フッターの高さ ★ */
  --footer-icon-size: 24px;   /* ★ アイコンサイズ ★ */
  --footer-font-size: 11px;   /* ★ タブ文字サイズ ★ */
  --footer-min-width: 90px;   /* ★ タブの最小幅 ★ */
  --footer-bottom-pad: 15px;  /* ★ フッター下の余白 ★ */
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'M PLUS Rounded 1c', 'Hiragino Kaku Gothic ProN', sans-serif;
  background: linear-gradient(160deg, var(--accent-bg1) 0%, var(--accent-bg2) 100%);
  background-attachment: fixed; color: var(--text);
  max-width: 480px; margin: 0 auto; min-height: 100vh;
}

/* ===== 認証画面 ===== */
.auth-screen {
  position: fixed; inset: 0;
  background: linear-gradient(160deg, var(--accent-bg1) 0%, var(--accent-bg2) 100%);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  z-index: 999; padding: 32px;
}
.auth-screen.show { display: flex; }
.auth-logo { font-size: 48px; margin-bottom: 16px; }
.auth-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; text-align: center; }
.auth-sub { font-size: 13px; color: var(--text-sub); margin-bottom: 32px; }
.auth-box {
  width: 100%; max-width: 320px; background: var(--white);
  border-radius: 20px; padding: 24px; box-shadow: 0 4px 24px rgba(var(--accent-rgb, 249,168,201),0.2);
}
.auth-label { font-size: 12px; font-weight: 700; color: var(--text-sub); margin-bottom: 8px; }
.auth-input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px;
  font-family: inherit; font-size: 16px; color: var(--text); background: var(--bg);
  outline: none; margin-bottom: 12px;
}
.auth-input:focus { border-color: var(--pink); background: var(--white); }
.auth-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-sub));
  border: none; border-radius: 10px;
  font-family: inherit; font-size: 16px; font-weight: 700; color: #fff; cursor: pointer;
}
.auth-btn:disabled { opacity: 0.6; cursor: default; }
.auth-error { font-size: 12px; color: var(--red); margin-top: 8px; text-align: center; min-height: 18px; }

/* ===== 全画面ローディング ===== */
.full-loading {
  position: fixed; inset: 0;
  background: linear-gradient(160deg, var(--accent-bg1) 0%, var(--accent-bg2) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 998; gap: 14px;
}
.full-loading.hide { display: none; }
.full-loading .msg { font-size: 13px; color: var(--text-sub); }
.full-loading .err { font-size: 13px; color: var(--red); text-align: center; line-height: 1.8; padding: 0 32px; }

/* ===== ヘッダー ===== */
.header {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-sub) 100%);
  padding: 16px 16px 14px; position: sticky; top: 0; z-index: 20;
}
.header-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.header-title { flex: 1; font-size: 20px; font-weight: 700; color: #fff; }
.header-sub { font-size: 12px; color: rgba(255,255,255,0.85); }
.header-btn {
  background: rgba(255,255,255,0.22); border: none; border-radius: 99px;
  padding: 6px 12px; color: #fff; font-family: inherit;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.header-btn:active { background: rgba(255,255,255,0.4); }

/* view用ヘッダー */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.9); border-radius: 22px; padding: 8px 14px; margin-top: 10px;
}
.search-box svg { flex-shrink: 0; opacity: 0.45; }
.search-box input {
  border: none; background: none; outline: none;
  font-family: inherit; font-size: 14px; color: var(--text); width: 100%;
}
.search-box input::placeholder { color: #bbb; }
.reload-btn {
  background: rgba(255,255,255,0.22); border: none; border-radius: 50%;
  width: 36px; height: 36px; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.reload-btn:active { background: rgba(255,255,255,0.4); }
.header-updated {
  font-size: 11px; font-weight: 500; color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.2); border-radius: 20px; padding: 3px 9px;
  white-space: nowrap; flex-shrink: 0; display: none;
}

/* ===== 削除モードバー（edit） ===== */
.delete-bar {
  display: none; align-items: center; justify-content: space-between;
  background: #fff0f0; border-bottom: 1px solid #fcc;
  padding: 10px 14px; gap: 10px;
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 50;
}
.delete-bar.show { display: flex; }
.delete-bar-label { font-size: 13px; font-weight: 700; color: var(--red); flex: 1; }
.delete-cancel-btn {
  border: 1.5px solid var(--border); background: var(--white);
  border-radius: 99px; padding: 6px 14px; font-family: inherit;
  font-size: 13px; color: var(--text-sub); cursor: pointer;
}
.delete-exec-btn {
  border: none; background: var(--red); border-radius: 99px; padding: 6px 14px;
  font-family: inherit; font-size: 13px; font-weight: 700; color: #fff; cursor: pointer;
}
.delete-exec-btn:disabled { opacity: 0.4; cursor: default; }

/* ===== アップロードゾーン（edit） ===== */
.upload-zone {
  margin: 16px 12px 0; border: 2.5px dashed var(--border);
  border-radius: var(--radius); background: var(--white);
  padding: 32px 16px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s; position: relative;
}
.upload-zone.drag-over { border-color: var(--pink); background: var(--pink-bg); }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon { font-size: 40px; margin-bottom: 10px; }
.upload-label { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.upload-sub { font-size: 12px; color: var(--text-sub); }

/* ===== プログレス（edit） ===== */
.progress-wrap { margin: 14px 12px 0; display: none; }
.progress-wrap.show { display: block; }
.progress-label { font-size: 12px; color: var(--text-sub); margin-bottom: 6px; }
.progress-bar-bg { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-sub)); border-radius: 99px; width: 0%; transition: width 0.3s; }

/* ===== セクション ===== */
.section-title {
  font-size: 13px; font-weight: 700; color: var(--text-sub);
  padding: 18px 14px 8px; display: flex; align-items: center; gap: 6px;
}
.badge { background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 8px; }
.badge.done { background: var(--green); }

/* ===== グリッド ===== */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 14px 12px 8px; }

/* ===== カード（共通） ===== */
.card-wrap { position: relative; }
.card-check {
  display: none; position: absolute; top: 6px; left: 6px; z-index: 10;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--border);
  align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2); pointer-events: none;
}
.card-check.checked { background: var(--red); border-color: var(--red); }
.card-check svg { display: none; }
.card-check.checked svg { display: block; }
.delete-mode .card-check { display: flex; }
.delete-mode .card-wrap { cursor: pointer; }

.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 2px 10px rgba(var(--accent-rgb, 249,168,201),0.15);
  border: 2px solid transparent; transition: border-color 0.2s, opacity 0.2s; cursor: pointer;
}
.card:active { transform: scale(0.97); }
.card.incomplete { border-color: var(--pink); }
.card.complete   { border-color: var(--green); }
.card.error      { border-color: var(--red); }
.card.selected   { border-color: var(--red); opacity: 0.7; }

.card-img {
  width: 100%; padding-top: 105%; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--accent-card-bg1) 0%, var(--accent-card-bg2) 100%);
}
.card-img img {
  /* 画像位置調整：top で上下、height で拡大率を変える */
  /* 例）top: -5% にすると少し上寄り、top: -15% にすると更に上寄り */
  /* height: 180% にすると縮小、220% にすると拡大 */
  position: absolute; top: -10%; left: 0; width: 100%; height: 200%;
  object-fit: cover; object-position: top center; display: block;
  opacity: 0; transition: opacity 0.3s;
}
.card-img img.loaded { opacity: 1; }
.card-img .no-img {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--accent-card-bg1), var(--accent-card-bg2));
}
.card-img .uploading-overlay {
  position: absolute; inset: 0; background: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center; font-size: 24px; z-index: 2;
}
.card-status-badge {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  font-size: 10px; font-weight: 700; border-radius: 99px; padding: 3px 8px;
  background: var(--pink); color: #fff;
}
.card-status-badge.done  { background: var(--green); }
.card-status-badge.error { background: var(--red); }

.card-body { padding: 8px 10px 11px; border-top: 1px solid var(--border); }
.card-chara { font-size: 10px; font-weight: 700; color: var(--pink); letter-spacing: 0.05em; margin-bottom: 3px; min-height: 13px; }
.card-name {
  font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 19px;
}

/* edit用 入力欄 */
.input-row { margin-bottom: 8px; }
.input-label { font-size: 10px; font-weight: 700; color: var(--text-sub); margin-bottom: 4px; }
.input-field {
  width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: 7px 10px;
  font-family: inherit; font-size: 13px; color: var(--text); background: var(--bg);
  outline: none; transition: border-color 0.2s;
}
.input-field:focus { border-color: var(--pink); background: var(--white); }
.save-status { font-size: 10px; text-align: right; margin-top: 4px; color: var(--text-sub); min-height: 14px; }
.save-status.ok  { color: var(--green); }
.save-status.err { color: var(--red); }

/* ===== ページネーション（view） ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 12px 16px 16px; flex-wrap: wrap; }
.pg-btn {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 50%; width: 36px; height: 36px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  color: var(--text-sub); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.13s, color 0.13s;
}
.pg-btn.active { background: linear-gradient(135deg, var(--accent), var(--accent-sub)); border-color: var(--pink); color: #fff; font-weight: 700; }
.pg-btn.arrow { font-size: 16px; }
.pg-btn:not(:disabled):not(.active):active { background: var(--pink-bg); }
.pg-btn:disabled { opacity: 0.3; cursor: default; }
.pg-ellipsis { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--text-sub); font-size: 13px; }

/* ===== 状態表示 ===== */
.state { grid-column: 1/-1; padding: 56px 16px; text-align: center; color: var(--text-sub); font-size: 14px; line-height: 2; }
.state .ico { display: block; margin-bottom: 10px; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--text-sub); font-size: 14px; line-height: 2; }
.empty-state .ico { display: block; font-size: 40px; margin-bottom: 10px; }
.loading-sheet { text-align: center; padding: 24px 16px; color: var(--text-sub); font-size: 13px; }

/* ===== フッター（view） ===== */
.footer {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: calc(var(--footer-h) + var(--footer-bottom-pad));
  background: var(--white); border-top: 1px solid var(--accent-border);
  display: flex; overflow-x: auto; z-index: 30; scrollbar-width: none;
  padding-bottom: var(--footer-bottom-pad);
  align-items: flex-start;
}
.footer::-webkit-scrollbar { display: none; }
.nav-btn {
  flex: 0 0 auto; min-width: var(--footer-min-width); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  border: none; background: none; cursor: pointer;
  font-family: inherit; color: #bdbdbd; font-size: var(--footer-font-size); font-weight: 500;
  padding: 6px 8px; transition: color 0.15s; position: relative; white-space: nowrap;
}
.nav-btn svg { width: var(--footer-icon-size); height: var(--footer-icon-size); transition: transform 0.15s; }
.nav-btn.active { color: var(--pink); }
.nav-btn.active svg { transform: scale(1.15); }
.nav-btn.active::after {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%;
  height: 2.5px; background: linear-gradient(90deg, var(--accent), var(--accent-sub)); border-radius: 0 0 3px 3px;
}

/* ===== モーダル（view） ===== */
.overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.72);
  z-index: 100; align-items: center; justify-content: center; padding: 16px;
}
.overlay.open { display: flex; }
.modal { position: relative; width: min(320px, 82vw); animation: pop .2s ease-out; }
@keyframes pop { from { transform: scale(0.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-img-wrap {
  width: 100%; aspect-ratio: 2/3; border-radius: 18px; overflow: hidden;
  box-shadow: 0 8px 40px rgba(180,120,200,0.3);
  background: linear-gradient(160deg, var(--accent-card-bg1), var(--accent-card-bg2));
}
.modal-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-close {
  position: absolute; top: -14px; right: -14px;
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25); font-size: 18px; color: #555;
}
.modal-close:active { background: #eee; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #444; color: #fff; font-size: 13px; border-radius: 99px; padding: 10px 20px;
  opacity: 0; transition: opacity 0.3s; white-space: nowrap; z-index: 9999; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ===== スピナー ===== */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 0.8s linear infinite; }

.pad-bottom { padding-bottom: 40px; }
.pad-bottom-footer { padding-bottom: calc(var(--footer-h) + var(--footer-bottom-pad) + 8px); }

/* ===== 設定パネル ===== */
.settings-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 200;
}
.settings-overlay.open { display: block; }

.settings-panel {
  display: none;
  position: fixed; top: 0; width: 300px; height: 100%;
  background: var(--white); z-index: 201;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}
.settings-panel.open {
  display: flex;
  animation: slideInRight 0.25s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.settings-header {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-sub) 100%);
  padding: 16px; display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.settings-header-title { flex: 1; font-size: 16px; font-weight: 700; color: #fff; }
.settings-close-btn {
  background: rgba(255,255,255,0.22); border: none; border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.settings-body { padding: 16px; overflow-y: auto; flex: 1; }

.settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.settings-item:last-child { border-bottom: none; }
.settings-item-label { flex: 1; }
.settings-item-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.settings-item-desc  { font-size: 11px; color: var(--text-sub); line-height: 1.5; }

/* トグルスイッチ */
.toggle {
  position: relative; width: 44px; height: 24px; flex-shrink: 0; margin-left: 12px;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border);
  border-radius: 99px; cursor: pointer; transition: background 0.2s;
}
.toggle-slider::before {
  content: ""; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--pink); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ===== 設定パネル：画像アップロード ===== */
.settings-divider {
  height: 1px;
  background: #f3e6f0;
  margin: 8px 0;
}
.settings-img-upload-block {
  padding: 12px 0 8px;
}
.settings-img-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.settings-img-pick-btn {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.settings-img-send-btn {
  padding: 6px 14px;
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.settings-img-send-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.settings-img-status {
  font-size: 12px;
  color: #999;
  min-height: 16px;
  margin-top: 4px;
}

.settings-img-hint {
  font-size: 11px;
  color: #bbb;
  margin-top: 2px;
}

/* ===== 編集ページ：検索・フィルター ===== */
.edit-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 10px;
}
.edit-search-row .search-box {
  flex: 1;
}
.filter-btn {
  white-space: nowrap;
  padding: 6px 14px;
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}
.filter-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ===== 結合モード ===== */
.combine-btn { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }
.combine-btn.active { background: var(--accent); color: #fff; }

.combine-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-sub));
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
  align-items: center;
  gap: 10px;
}
.combine-bar.show { display: flex; }
.combine-bar-label { flex: 1; font-size: 14px; font-weight: 700; }
.combine-cancel-btn {
  padding: 6px 14px;
  background: rgba(255,255,255,0.3);
  border: none;
  border-radius: 20px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.combine-exec-btn {
  padding: 6px 14px;
  background: #fff;
  border: none;
  border-radius: 20px;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.combine-exec-btn:disabled { opacity: 0.4; cursor: default; }

.card.combine-selected { outline: 3px solid var(--accent); outline-offset: 2px; opacity: 0.85; }

/* 結合結果モーダル */
.combine-modal {
  position: relative;
  width: 92vw;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 16px;
  background: #fff;
  padding: 48px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.combine-modal .modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}
.combine-img-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}
.combine-text-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#combine-text {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  background: var(--accent-soft-bg);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  margin: 0;
}
.combine-copy-btn {
  align-self: flex-end;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-sub));
  border: none;
  border-radius: 20px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ===== 保存ボタン ===== */
.combine-save-btn {
  width: 100%;
  padding: 12px;
  background: #fff;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.combine-save-btn:active { background: var(--accent-soft-bg); }



.header-btn.active {
  background: var(--accent);
  color: #fff;
}


/* ===== テーマプリセット ===== */
[data-theme="purple"] {
  --pink: #b8a0e0; --pink-bg: #ede0f8; --accent: #c9b8f0; --accent-sub: #f0b8d4;
  --accent-bg1: #f5f0ff; --accent-bg2: #fff5fb; --accent-border: #d0b8e8;
  --accent-card-bg1: #ede0f8; --accent-card-bg2: #fde8f3;
  --accent-soft-bg: #f8f4fd; --border: #e0d0f0; --bg: #faf5ff;
  --text-sub: #a88cc4;
}
[data-theme="blue"] {
  --pink: #88bce8; --pink-bg: #e0f0ff; --accent: #a8d0f0; --accent-sub: #b8c8f0;
  --accent-bg1: #f0f7ff; --accent-bg2: #f0f0ff; --accent-border: #a0c8e8;
  --accent-card-bg1: #e0f0ff; --accent-card-bg2: #e0e8f8;
  --accent-soft-bg: #f4f8fd; --border: #d0e0f0; --bg: #f5faff;
  --text-sub: #8ca8c4;
}
[data-theme="mint"] {
  --pink: #7dd9b8; --pink-bg: #e0f8f0; --accent: #a0e8d0; --accent-sub: #b8e0c8;
  --accent-bg1: #f0fff8; --accent-bg2: #f0fff0; --accent-border: #88d0b8;
  --accent-card-bg1: #e0f8f0; --accent-card-bg2: #e0f0e8;
  --accent-soft-bg: #f4fdf8; --border: #c8e8d8; --bg: #f5fff8;
  --text-sub: #88b8a0;
}
[data-theme="orange"] {
  --pink: #f0b088; --pink-bg: #fff0e0; --accent: #f8c8a0; --accent-sub: #f0d0a8;
  --accent-bg1: #fffaf0; --accent-bg2: #fff8f0; --accent-border: #e8b888;
  --accent-card-bg1: #fff0e0; --accent-card-bg2: #f8e8d8;
  --accent-soft-bg: #fdf8f4; --border: #f0d8c0; --bg: #fffaf5;
  --text-sub: #c4a888;
}
[data-theme="lavender"] {
  --pink: #c0a8d8; --pink-bg: #f0e8f8; --accent: #d0b8e8; --accent-sub: #e0c0d8;
  --accent-bg1: #f8f0ff; --accent-bg2: #f8f0f8; --accent-border: #c8a8d8;
  --accent-card-bg1: #f0e8f8; --accent-card-bg2: #f0e0f0;
  --accent-soft-bg: #f8f4fd; --border: #e0d0e8; --bg: #faf5ff;
  --text-sub: #b098c0;
}

/* ===== テーマピッカー ===== */
.theme-picker {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  flex-wrap: wrap;
}
.theme-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: transform 0.15s, border-color 0.15s;
}
.theme-dot:active { transform: scale(0.9); }
.theme-dot.active {
  border-color: var(--text);
  transform: scale(1.1);
}

/* ===== viewヘッダー コメント ===== */
.header-comment {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.22);
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.header-comment:empty { display: none; }
