:root {
  /* Premium Dark Gray / Black Base (Default) */
  --bg-dark: #121214;
  --bg-card: #1C1C20;
  --border-subtle: rgba(255, 255, 255, 0.08);

  /* Sophisticated Pink Accents */
  --accent: #E9407A;
  --accent-soft: rgba(233, 64, 122, 0.15);
  --accent-soft-2: rgba(233, 64, 122, 0.3);
  --accent-muted: #F75A90;

  --text-main: #F2F2F5;
  --text-sub: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.45);

  /* Glass & Surface Opacities */
  --glass-2: rgba(255, 255, 255, 0.02);
  --glass-3: rgba(255, 255, 255, 0.03);
  --glass-4: rgba(255, 255, 255, 0.04);
  --glass-5: rgba(255, 255, 255, 0.05);
  --glass-6: rgba(255, 255, 255, 0.06);
  --glass-8: rgba(255, 255, 255, 0.08);
  --glass-10: rgba(255, 255, 255, 0.10);
  --glass-15: rgba(255, 255, 255, 0.15);
  --glass-18: rgba(255, 255, 255, 0.18);
  --glass-20: rgba(255, 255, 255, 0.20);
  --glass-25: rgba(255, 255, 255, 0.25);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.20);
  --btn-secondary-bg: rgba(40, 42, 58, 0.9);
  --btn-secondary-hover: rgba(58, 60, 82, 0.95);
  --btn-outline-bg: rgba(17, 18, 27, 0.95);

  --radius-lg: 16px;
  --radius-md: 10px;

  --max-w: 480px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Skeleton Config */
  --skeleton-base: rgba(255, 255, 255, 0.05);
  --skeleton-shine: rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] {
  /* Apple-like Light Gray / White Base */
  --bg-dark: #F5F5F7;
  --bg-card: #FFFFFF;
  --border-subtle: rgba(0, 0, 0, 0.08);

  /* Maintain Pink Accents, but slight adjustments if needed */
  --accent: #E9407A;
  --accent-soft: rgba(233, 64, 122, 0.08);
  --accent-soft-2: rgba(233, 64, 122, 0.15);
  --accent-muted: #D81B60;

  --text-main: #1D1D1F;
  --text-sub: rgba(0, 0, 0, 0.65);
  --text-muted: rgba(0, 0, 0, 0.45);

  /* Glass & Surface Opacities (inverted for light) */
  --glass-2: rgba(0, 0, 0, 0.01);
  --glass-3: rgba(0, 0, 0, 0.02);
  --glass-4: rgba(0, 0, 0, 0.03);
  --glass-5: rgba(0, 0, 0, 0.03);
  --glass-6: rgba(0, 0, 0, 0.04);
  --glass-8: rgba(0, 0, 0, 0.05);
  --glass-10: rgba(0, 0, 0, 0.06);
  --glass-15: rgba(0, 0, 0, 0.08);
  --glass-18: rgba(0, 0, 0, 0.10);
  --glass-20: rgba(0, 0, 0, 0.12);
  --glass-25: rgba(0, 0, 0, 0.15);
  --border-medium: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.15);
  --btn-secondary-bg: rgba(0, 0, 0, 0.06);
  --btn-secondary-hover: rgba(0, 0, 0, 0.10);
  --btn-outline-bg: rgba(245, 245, 247, 0.95);

  /* Skeleton Config for Light Mode */
  --skeleton-base: rgba(0, 0, 0, 0.05);
  --skeleton-shine: rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body.bg-compact {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

/* === 全体レイアウト === */
.wrap {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 14px 14px calc(40px + var(--safe-bottom));
  flex: 1 0 auto;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-main);
}

.muted {
  color: var(--text-muted) !important;
}

.tap-big * {
  line-height: 1.35;
}

.sp-16 {
  height: 16px;
}

.sp-24 {
  height: 24px;
}

/* === アプリヘッダー（バーではなく Discord / X っぽいヘッダー） === */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 24px;
}

.app-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', 'Inter', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 3.4rem;
  letter-spacing: 0.15em;
  color: #ff7ab8;
  /* ピンクのアクセント */
  text-shadow: 0 0 8px rgba(255, 182, 255, 0.3), 0 0 16px rgba(255, 130, 230, 0.15);
  user-select: none;
  animation: logo-glow 4s ease-in-out infinite alternate;
  transition: transform 0.3s ease;
}

.app-logo:hover {
  transform: scale(1.02);
}

.app-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.15), transparent 55%),
    linear-gradient(145deg, #22243a, #10111a);
  box-shadow:
    0 0 0 1px var(--glass-5),
    0 8px 18px rgba(0, 0, 0, 0.65);
  font-size: 1.1rem;
  color: var(--accent);
}

.app-logo-mark i {
  display: block;
  transform: translateY(1px);
}

.app-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.app-logo-main {
  font-size: 1.5rem;
  /* ← ここでロゴの大きさをUP（1.4〜1.6remが自然） */
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow:
    0 0 8px rgba(255, 182, 255, 0.4),
    0 0 18px rgba(255, 130, 230, 0.25);
  animation: logo-glow 4s ease-in-out infinite alternate;
}

.app-logo-sub {
  font-size: .72rem;
  color: var(--text-muted);
  letter-spacing: .06em;
}

.app-logo-icon {
  width: 28px;
  height: 28px;
  margin-right: 8px;
  filter: drop-shadow(0 0 6px rgba(255, 122, 184, 0.4));
  animation: logo-glow 4s ease-in-out infinite alternate;
}

/* 右側：プランピル＋ログアウトリンク */
.app-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--accent);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 0 6px #ff7ab880;
  /* ✨やわらかい発光 */
  transition: text-shadow 0.3s ease, color 0.3s ease;
}

.plan-pill i {
  font-size: .9rem;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(255, 122, 184, 0.5);
}

/* optional: hoverで少し光を強くする */
.plan-pill:hover {
  text-shadow: 0 0 10px rgba(255, 122, 184, 0.8);
}

.upgrade-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(233, 64, 122, 0.1);
  border: 1px solid rgba(233, 64, 122, 0.35);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-shadow: 0 0 6px rgba(233, 64, 122, 0.4);
  box-shadow: 0 0 10px rgba(233, 64, 122, 0.15);
  transition: all 0.3s ease;
}

.upgrade-pill i {
  font-size: 0.85rem;
}

.upgrade-pill:hover {
  background: rgba(233, 64, 122, 0.2);
  box-shadow: 0 0 16px rgba(233, 64, 122, 0.35);
  color: var(--accent);
  border-color: rgba(233, 64, 122, 0.5);
  text-shadow: 0 0 10px rgba(233, 64, 122, 0.6);
}

.logout-link {
  font-size: .8rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 2px;
  border-radius: 6px;
  transition: color .18s ease, background .18s ease;
}

.logout-link:hover {
  color: #ffffff;
  background: var(--glass-4);
}

/* ナビバー: マイページアバターリンク */
.user-avatar-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(233, 64, 122, 0.1);
  border: 1px solid rgba(233, 64, 122, 0.3);
  color: var(--accent);
  font-size: 1.15rem;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar-link:hover {
  background: rgba(233, 64, 122, 0.2);
  border-color: rgba(233, 64, 122, 0.5);
  color: #FF7AB8;
  box-shadow: 0 0 12px rgba(233, 64, 122, 0.2);
}

/* プランアイコン（テキストなし） */
.plan-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(233, 64, 122, 0.1);
  border: 1px solid rgba(233, 64, 122, 0.3);
  color: var(--accent);
  font-size: 1.1rem;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.plan-icon-link:hover {
  background: rgba(233, 64, 122, 0.2);
  border-color: rgba(233, 64, 122, 0.5);
  color: #FF7AB8;
  box-shadow: 0 0 12px rgba(233, 64, 122, 0.2);
}

.plan-icon-link.plan-glow {
  animation: plan-star-glow 2.5s ease-in-out infinite alternate;
}

@keyframes plan-star-glow {
  0% {
    box-shadow: 0 0 4px rgba(233, 64, 122, 0.15);
  }

  100% {
    box-shadow: 0 0 14px rgba(233, 64, 122, 0.5), 0 0 4px rgba(255, 122, 184, 0.3);
  }
}

/* === カード（共通） === */
.card-mobile {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  padding: 16px;
  animation: fadeUpCard 0.4s ease-out forwards;
  opacity: 0;
  transform: translateY(6px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-mobile:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

@keyframes fadeUpCard {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === フォーム / テキスト === */
h1,
h2,
h3,
h4,
h5 {
  color: var(--text-main);
}

p {
  color: var(--text-sub);
}

label.form-label {
  color: var(--text-sub);
  font-size: .9rem;
}

.form-control,
.form-select {
  background: var(--bg-dark);
  color: var(--text-main);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: .8rem 1rem;
  font-size: 16px;
  /* 16px固定でスマホの入力ズームを防止 */
  min-height: 52px;
  /* タップターゲットの拡大 */
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft-2);
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
}

.form-check-input {
  background-color: var(--bg-dark);
  border-color: var(--border-subtle);
  box-shadow: none;
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.form-check-input:focus {
  box-shadow: 0 0 0 .16rem rgba(255, 126, 182, 0.3);
}

.alert {
  border-radius: 14px;
  border: none;
  padding: .75rem .9rem;
  font-size: .9rem;
  margin-bottom: 14px;
}

.alert-pink {
  background: rgba(233, 64, 122, 0.1);
  border: 1px solid var(--accent);
  color: #F75A90;
  box-shadow: none;
  display: flex;
  align-items: center;
}

.alert-danger {
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid #dc3545;
  color: #ff6b7a;
  box-shadow: none;
  display: flex;
  align-items: center;
}

/* === ボタン系（ピンクをきっちり効かせる） === */

/* 塗りボタン（メインアクション） */
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: .05em;
  min-height: 56px;
  box-shadow: 0 4px 12px rgba(233, 64, 122, 0.3);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn-accent:hover {
  transform: translateY(-1px);
  background: var(--accent-muted);
  box-shadow: 0 6px 16px rgba(233, 64, 122, 0.4);
  color: #ffffff;
}

.btn-accent:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(233, 64, 122, 0.2);
}

/* 枠だけピンク（サブアクション） */
.btn-outline-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--glass-18);
  background: var(--btn-outline-bg);
  color: var(--text-sub);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: .05em;
  min-height: 50px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.btn-outline-accent:hover {
  background: rgba(24, 25, 36, 1);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--accent-muted);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

/* ゴースト（ダッシュボードなどで使用） */
.btn-ghost-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-soft-2);
  background: var(--glass-3);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 500;
  min-height: 50px;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.btn-ghost-accent:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
  color: var(--accent-muted);
}

.btn-ghost-accent:active {
  transform: scale(0.98);
}

/* Bootstrap の .btn-secondary も馴染むように */
.btn-secondary {
  border-radius: 999px;
  background: var(--btn-secondary-bg);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  font-size: .85rem;
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  border-color: var(--glass-20);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

@media (max-width: 600px) {
  .wrap {
    padding-inline: 14px;
  }

  .app-logo-main {
    font-size: .9rem;
  }

  .app-logo-sub {
    font-size: .7rem;
  }

  .card-mobile {
    padding: 20px 16px;
  }

  /* ボトムシート化 */
  .img-modal {
    align-items: flex-end;
    /* 下寄せに */
    padding: 0;
    /* paddingをなくして画面端まで広げる */
  }

  .img-modal-card {
    max-width: 100%;
    margin: 0;
    border-radius: 20px 20px 0 0;
    /* 上の角だけ丸める */
    max-height: 90vh;
    border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* 余白削減によりコンテンツが見やすくなる */
  .modal-grabber {
    display: block;
    /* スマホのときだけ引き下げバーを表示（装飾） */
  }

  .img-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    /* スマホサイズのタイル調整 */
  }
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes logo-glow {
  0% {
    text-shadow: 0 0 6px rgba(255, 182, 255, 0.2),
      0 0 12px rgba(255, 130, 230, 0.1);
  }

  100% {
    text-shadow: 0 0 12px rgba(255, 182, 255, 0.5),
      0 0 30px rgba(255, 130, 230, 0.3);
  }
}

.plan-remaining {
  color: var(--accent);
  margin-left: 6px;
  font-weight: 500;
  font-size: 0.78rem;
  text-shadow: 0 0 6px rgba(255, 122, 184, 0.5);
}

/* === フォームパーツのピンクスタイル統一 === */
.form-check.form-switch {
  padding-left: 3.5rem;
  min-height: 32px;
  display: flex;
  align-items: center;
}

/* 共通フォーカス・アクティブ状態 */
.form-check-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.25rem rgba(255, 122, 184, 0.25);
}

.form-check-input:active {
  filter: brightness(1.1);
  box-shadow: 0 0 0 0.25rem rgba(255, 122, 184, 0.3);
}

/* 共通チェック状態の色 */
.form-check-input:checked {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* === 通常のチェックボックス・ラジオボタン用 === */
.form-check-input:not([role="switch"]) {
  background-color: rgba(255, 255, 255, 0.05);
  /* ダークな背景 */
  border-color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

.form-check-label {
  font-size: 1.05rem;
  line-height: 1.5rem;
  padding-left: 0.5rem;
  cursor: pointer;
}

/* === スイッチ（トグル）専用スタイル === */
.form-switch .form-check-input {
  background-color: #1f2130;
  border-color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  width: 3rem !important;
  height: 1.5rem !important;
  margin-left: -3.5rem !important;
  margin-top: 0;
  border-radius: 2rem !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(255,255,255,0.7)'/%3e%3c/svg%3e") !important;
}

.form-switch .form-check-input:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
}

.form-switch .form-check-input:checked::before {
  background-color: #fff;
}

/* Safariなど独自描画の補正 */
.form-check-input:checked[type="checkbox"] {
  accent-color: var(--accent);
}

/* === Modern Pink Slider === */
.pink-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-soft-2);
  outline: none;
  cursor: pointer;
  transition: opacity .15s ease;
}

.pink-slider:hover {
  opacity: 0.9;
}

/* === Thumb (Chrome / Edge / Safari) === */
.pink-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;

  background: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);

  transition:
    transform .15s ease,
    box-shadow .15s ease;
}

.pink-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.pink-slider::-webkit-slider-thumb:active {
  transform: scale(0.95);
  background: var(--accent-muted);
}

/* === Firefox === */
.pink-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;

  background: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* === Value Label === */
.slider-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .02em;
}

/* === Scale Text === */
.slider-scale {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== 写メ確認モーダル ===== */
.img-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  padding: 0;
  align-items: flex-end;
  justify-content: center;
}

.img-modal[aria-hidden="true"] {
  display: none !important;
}

.img-modal[aria-hidden="false"] {
  display: flex !important;
}

.img-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.img-modal-card {
  position: relative;
  width: 100%;
  background: #1a1a22;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .6);
  display: flex;
  flex-direction: column;
  height: 92vh;
  animation: modal-slide-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(60px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-grabber {
  display: block;
  width: 36px;
  height: 4px;
  background: var(--glass-20);
  border-radius: 999px;
  margin: 10px auto 0;
}

.img-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 12px 20px;
  border-bottom: 1px solid var(--glass-6);
}

.img-modal-title {
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  letter-spacing: .02em;
}

.img-modal-sub {
  font-size: .82rem;
  color: var(--accent);
  font-weight: 500;
}

.img-modal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.img-search {
  display: none;
}

.img-btn {
  background: var(--glass-8);
  border: 1px solid var(--glass-10);
  border-radius: 10px;
  padding: 8px 14px;
  color: #fff;
  font-size: .82rem;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.img-btn:active {
  background: var(--glass-18);
}

.img-close {
  background: var(--glass-6);
  border: 1px solid var(--glass-10);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.img-close:active {
  background: var(--glass-18);
}

.img-modal-body {
  overflow-y: auto;
  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  flex: 1;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.img-tile {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  aspect-ratio: 1;
}

.img-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  -webkit-tap-highlight-color: transparent;
}

.img-del:active {
  background: rgba(220, 53, 69, 0.85);
}

.img-empty,
.img-loading,
.img-end {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Desktop: centered modal */
@media (min-width: 601px) {
  .img-modal {
    align-items: center;
    padding: 24px;
  }

  .img-modal-card {
    max-width: 520px;
    height: auto;
    max-height: 85vh;
    border-radius: 16px;
  }

  .modal-grabber {
    display: none;
  }

  .img-modal-body {
    padding: 16px;
  }

  .img-grid {
    gap: 6px;
  }

  .img-tile {
    border-radius: 8px;
  }
}

.editor-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  background: #000;
  /* Full blackout for editing */
}

.editor-modal[aria-hidden="false"] {
  display: block;
}

.editor-card {
  position: absolute;
  inset: 0;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.editor-title {
  font-weight: 600;
  color: #fff;
  letter-spacing: .02em;
}

.editor-btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: .95rem;
}

.editor-primary {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.editor-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 10px;
}

#editorCanvas {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: #000;
}

/* 下部ツールバー（押しやすさ重視） */
.editor-toolbar {
  position: sticky;
  bottom: 0;
  padding: 10px 10px calc(10px + var(--safe-bottom, 0));
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: rgba(12, 12, 18, .92);
}

.tool-btn {
  border: none;
  border-radius: 14px;
  padding: 12px 6px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: .8rem;
}

/* 素材シート */
.asset-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 72px;
  /* toolbar の上 */
  max-height: 52vh;
  background: #121216;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  transform: translateY(120%);
  transition: transform .18s ease;
  display: flex;
  flex-direction: column;
}

.asset-sheet[aria-hidden="false"] {
  transform: translateY(0);
}

.asset-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.asset-sheet-title {
  color: #fff;
  font-weight: 600;
}

.asset-sheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.opacity-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .8);
  font-size: .8rem;
}

.opacity-wrap input {
  width: 110px;
}

.asset-grid {
  padding: 12px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.asset-item {
  border-radius: 14px;
  overflow: hidden;
  background: var(--glass-6);
  border: 1px solid rgba(255, 255, 255, .08);
}

.asset-item img {
  width: 100%;
  height: 72px;
  object-fit: contain;
  display: block;
  background: #000;
}

/* Improved contrast overrides */
.text-white-50,
.text-muted {
  opacity: 0.7 !important;
  color: #d8dbee !important;
}

/* ===== 通知ベル ===== */
.notif-bell-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(233, 64, 122, 0.1);
  border: 1px solid rgba(233, 64, 122, 0.3);
  color: var(--accent);
  font-size: 1.05rem;
  cursor: pointer;
  position: relative;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.notif-bell-btn:hover {
  background: rgba(233, 64, 122, 0.2);
  border-color: rgba(233, 64, 122, 0.5);
  color: #FF7AB8;
  box-shadow: 0 0 12px rgba(233, 64, 122, 0.2);
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(233, 64, 122, 0.4);
  animation: badge-pop .3s ease-out;
}

@keyframes badge-pop {
  0% {
    transform: scale(0);
  }

  60% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

/* ===== 通知ボトムシート ===== */
.notif-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  visibility: hidden;
  transition: background 0.25s ease, visibility 0s 0.25s;
}

.notif-sheet-overlay.open {
  visibility: visible;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.25s ease, visibility 0s;
}

.notif-sheet {
  width: 100%;
  max-width: var(--max-w);
  max-height: 70vh;
  background: #1a1a22;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.notif-sheet-overlay.open .notif-sheet {
  transform: translateY(0);
}

.notif-sheet-grabber {
  width: 36px;
  height: 4px;
  background: var(--glass-20);
  border-radius: 999px;
  margin: 10px auto 0;
}

.notif-sheet-header {
  display: flex;
  align-items: center;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--glass-6);
  gap: 8px;
}

.notif-sheet-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
}

.notif-sheet-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--glass-6);
  border: 1px solid var(--glass-10);
  color: var(--text-sub);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.notif-sheet-close:active {
  background: var(--glass-15);
}

.notif-read-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.15s;
  min-height: 36px;
}

.notif-read-btn:active {
  background: rgba(233, 64, 122, 0.15);
}

.notif-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding: 4px 0;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--glass-4);
  transition: background 0.15s;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:active {
  background: var(--glass-4);
}

.notif-item.unread {
  background: rgba(233, 64, 122, 0.06);
}

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.notif-icon.error {
  background: rgba(255, 107, 122, 0.15);
  color: #ff6b7a;
}

.notif-icon.success {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.notif-icon.info {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-msg {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.5;
  word-break: break-word;
}

.notif-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.notif-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.notif-del-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--glass-4);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  margin-top: 2px;
}

.notif-del-btn:hover {
  background: rgba(255, 107, 122, 0.15);
  color: #ff6b7a;
}

.notif-del-btn:active {
  background: rgba(255, 107, 122, 0.3);
  color: #ff6b7a;
}

/* === Skeleton Loading UI === */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton-body-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-dark);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  visibility: visible;
}

.skeleton-body-mask.loaded {
  opacity: 0;
  visibility: hidden;
}

.skeleton-wrap {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skeleton-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 20px;
}

.skeleton-box,
.skeleton-circle,
.skeleton-card {
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-md);
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-card {
  height: 140px;
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}

.skeleton-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: calc(65px + var(--safe-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: var(--safe-bottom);
}

.skeleton-nav-item {
  width: 32px;
  height: 32px;
}

/* === テーマ切替ボタン === */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--glass-6);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
  color: var(--accent);
  transform: rotate(20deg);
}

.theme-toggle-btn:active {
  transform: scale(0.92);
}

.plan-header-badge {
  position: absolute;
  top: -5px;
  right: -12px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(233, 64, 122, 0.4);
  pointer-events: none;
}

/* ========================================
   Skeleton Loading System
   ======================================== */
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton {
  background: var(--skeleton-base);
  background-image: linear-gradient(90deg,
      var(--skeleton-base) 0%,
      var(--skeleton-shine) 40%,
      var(--skeleton-base) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-text {
  height: 12px;
  margin-bottom: 8px;
  border-radius: 6px;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-title {
  height: 16px;
  width: 50%;
  margin-bottom: 12px;
  border-radius: 6px;
}

.skeleton-circle {
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  flex-shrink: 0;
}

.skeleton-btn {
  height: 40px;
  border-radius: 12px;
}

/* Store card skeleton (matches .card-mobile layout) */
.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  padding: 16px;
  animation: fadeUpCard 0.4s ease-out forwards;
  opacity: 0;
}

.skeleton-card .skeleton-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.skeleton-card .skeleton-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-card .skeleton-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 20px;
}

.skeleton-card .skeleton-row-label {
  height: 14px;
  width: 40%;
  border-radius: 6px;
}

.skeleton-card .skeleton-row-value {
  height: 14px;
  width: 25%;
  border-radius: 6px;
}

.skeleton-card .skeleton-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.skeleton-card .skeleton-actions .skeleton {
  flex: 1;
  height: 42px;
  border-radius: 12px;
}

/* Scheduled post skeleton */
.skeleton-sched {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.skeleton-sched .skeleton-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  flex-shrink: 0;
}

.skeleton-sched .skeleton-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ========================================
   Page Transition
   ======================================== */
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-content {
  animation: pageEnter 0.35s ease-out forwards;
}

.page-content.animation-done {
  animation: none;
}

.page-content.navigating {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Card skeleton overlay (for refresh) */
.card-skeleton-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card-skeleton-overlay.show {
  opacity: 1;
}

.card-skeleton-overlay .skeleton-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.card-skeleton-overlay .skeleton-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-skeleton-overlay .skeleton-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-skeleton-overlay .skeleton-row-label {
  height: 14px;
  width: 40%;
  border-radius: 6px;
}

.card-skeleton-overlay .skeleton-row-value {
  height: 14px;
  width: 25%;
  border-radius: 6px;
}