@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+JP:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  /* Clean & Minimal Light Theme */
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-muted: #e2e8f0;

  --border-subtle: #f1f5f9;
  --border-card: #e2e8f0;
  --border-highlight: #cbd5e1;
  --border-focus: #3b82f6;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;

  /* =========================================================
     PLAN A: MINIMAL MONOTONE TIMELINE & DISTINCT STATUS/GENRE
     ========================================================= */
  /* Pillar / Timeframe Accents (時間軸: 洗練されたモノトーン・トーン差階層) */
  /* Short-term (白基調・クリーンなホワイトバッジ) */
  --color-short: #0f172a;
  --color-short-bg: #ffffff;
  --color-short-border: #cbd5e1;
  --color-short-bar: #334155;
  --color-short-text: #0f172a;

  /* Mid-term (発展・中期・淡いスレート) */
  --color-mid: #334155;
  --color-mid-bg: #f1f5f9;
  --color-mid-border: #cbd5e1;
  --color-mid-bar: #334155;
  --color-mid-text: #0f172a;

  /* Long-term (大局・未来・ソフトグレー) */
  --color-long: #64748b;
  --color-long-bg: #e2e8f0;
  --color-long-border: #cbd5e1;
  --color-long-bar: #334155;
  --color-long-text: #0f172a;

  /* Semantic Status Colors (状態の普遍色: 進行中=青, 完了=緑, 未着手=灰) */
  --status-planning-bg: #f8fafc;
  --status-planning-text: #64748b;
  --status-planning-border: #e2e8f0;
  --status-planning-dot: #94a3b8;

  --status-progress-bg: #eff6ff;
  --status-progress-text: #1d4ed8;
  --status-progress-border: #bfdbfe;
  --status-progress-dot: #2563eb;

  --status-achieved-bg: #ecfdf5;
  --status-achieved-text: #047857;
  --status-achieved-border: #a7f3d0;
  --status-achieved-dot: #059669;

  /* Genre Accent Colors (事業シグネチャーカラー: ステータス青・緑・灰と被らない配色) */
  --genre-personal: #d97706;
  --genre-personal-bg: rgba(217, 119, 6, 0.1);
  --genre-personal-border: #fde68a;

  --genre-saas: #7c3aed;
  --genre-saas-bg: rgba(124, 58, 237, 0.1);
  --genre-saas-border: #ddd6fe;

  --genre-venture: #e11d48;
  --genre-venture-bg: rgba(225, 29, 72, 0.1);
  --genre-venture-border: #fecdd3;

  /* Typography */
  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', 'Noto Sans JP', sans-serif;

  /* Shadows & Transitions */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
  --shadow-card-hover: 0 4px 14px -2px rgba(0, 0, 0, 0.07);
  --shadow-modal: 0 20px 35px -8px rgba(0, 0, 0, 0.12);

  --transition-fast: 0.14s ease;
  --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* NO-SCROLL / VIEWPORT LOCK */
html, body {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Container - 100% Viewport Locked */
.app-container {
  width: 100%;
  height: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0.8vh 1.6vw;
  display: flex;
  flex-direction: column;
  gap: 0.7vh;
  overflow: hidden;
}

/* =========================================================
   1. GLOBAL NAVIGATION BAR (For Future Multi-page Routing)
   Height: ~ 4.8% of Viewport
   ========================================================= */
.global-nav {
  height: 4.8vh;
  min-height: 36px;
  max-height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.8rem;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand-logo {
  font-size: 1.15rem;
}

.nav-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.nav-version-tag {
  font-size: 0.675rem;
  padding: 0.1rem 0.45rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: 4px;
  color: var(--text-secondary);
  font-weight: 600;
}

.nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.nav-back-btn:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.sync-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.5rem;
  background: var(--status-achieved-bg);
  border: 1px solid var(--status-achieved-border);
  border-radius: 9999px;
  font-size: 0.675rem;
  color: var(--status-achieved-text);
  font-weight: 500;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.sync-dot.connected {
  background-color: var(--status-achieved-dot);
}

.sync-dot.disconnected {
  background-color: #94a3b8;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--text-primary);
  color: #ffffff;
  font-weight: 600;
}

.nav-badge-soon {
  font-size: 0.6rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: #fee2e2;
  color: #dc2626;
  font-weight: 600;
  line-height: 1.2;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* =========================================================
   2. DASHBOARD KPI BAR
   Height: ~ 4.5% of Viewport
   ========================================================= */
.dashboard-header {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
  user-select: none;
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

.btn-primary {
  background: #0f172a;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1e293b;
}

.btn-glass {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-card);
}

.btn-glass:hover {
  background: var(--bg-subtle);
  border-color: var(--border-highlight);
}

/* Compact KPI Bar */
.kpi-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8vw;
  padding: 0.45vh 0.8vw;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.kpi-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.kpi-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bullet-all { background-color: #64748b; }
.bullet-progress { background-color: #2563eb; }
.bullet-achieved { background-color: #059669; }
.bullet-rate { background-color: #7c3aed; }

.kpi-content {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.kpi-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

/* =========================================================
   3. 3-COLUMN MAIN DASHBOARD
   Height: ~ 78% of Viewport (Flex: 1, No Outer Scroll)
   ========================================================= */
.dashboard-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2vw;
  height: 100%;
}

.dashboard-column {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0.65vh;
}

/* Level 1: Pillar Header Card (1段目)
   Height: ~ 30% of Column Height */
.pillar-card {
  position: relative;
  background: #ffffff;
  border-radius: 9px;
  padding: 0.65rem 0.85vw 0.55rem 0.85vw;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: 125px;
  max-height: 165px;
  flex-shrink: 0;
  gap: 0.25rem;
}

.pillar-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.pillar-term-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  line-height: 1.2;
}

.pillar-short .pillar-term-badge {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pillar-mid .pillar-term-badge {
  background: var(--color-mid-bg);
  color: var(--color-mid-text);
  border: 1px solid var(--color-mid-border);
}

.pillar-long .pillar-term-badge {
  background: var(--color-long-bg);
  color: var(--color-long-text);
  border: 1px solid var(--color-long-border);
}

.pillar-timeframe {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pillar-edit-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.pillar-edit-btn:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
  border-color: var(--border-card);
}

.pillar-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin: 0.1rem 0;
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pillar-bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.15rem 0 0 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 0.25rem;
}

.pillar-bullet-list::-webkit-scrollbar {
  width: 3px;
}

.pillar-bullet-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.pillar-bullet-item {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.4;
  position: relative;
  padding-left: 0.7rem;
}

.pillar-bullet-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.pillar-short .pillar-bullet-item::before { background-color: var(--color-short); }
.pillar-mid .pillar-bullet-item::before { background-color: var(--color-mid); }
.pillar-long .pillar-bullet-item::before { background-color: var(--color-long); }

/* =========================================================
   HOME: PROJECTS UNDER PILLARS (進行中の事業 / 未着手の事業 カード分離)
   ========================================================= */
.home-projects-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: #f8fafc;
  border: 1px solid var(--border-card);
  border-radius: 9px;
  padding: 0.4rem 0.65rem 0.45rem 0.65rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.home-projects-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.1rem;
  height: 20px;
}

.home-projects-label {
  font-size: 0.725rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.home-projects-count {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.04rem 0.35rem;
  border-radius: 9999px;
  line-height: 1.2;
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.home-projects-link {
  font-size: 0.675rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.home-projects-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.home-projects-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Home Project Single Card (高さをかなり抑えたスリム行カード) */
.home-project-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  min-height: 27px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.home-project-card:hover {
  background: #ffffff;
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.home-project-card .project-bullet-marker {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  top: -3px;
  transition: transform var(--transition-fast);
}

.home-project-card:hover .project-bullet-marker {
  transform: scale(1.3);
}

.home-project-title {
  flex: 1;
  min-width: 0;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  transition: color var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-project-card:hover .home-project-title {
  color: #0f172a;
}

.home-project-badges {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.home-project-card .status-badge {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.06rem 0.38rem;
  min-width: 3.2rem;
  border-radius: 9999px;
  line-height: 1.2;
}

.home-projects-empty {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.2rem 0;
}
/* Level 2: Ambitions List Section (2段目: 個人目標)
   Height: ~ 67% of Column Height (Scrollable Inside Only) */
.ambitions-list-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: #f8fafc;
  border: 1px solid var(--border-card);
  border-radius: 9px;
  padding: 0.45rem 0.65rem 0.55rem 0.65rem;
  box-shadow: var(--shadow-sm);
}

.ambitions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.1rem;
  flex-shrink: 0;
  height: 20px;
}

.ambitions-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.01em;
}

.ambition-count {
  font-size: 0.675rem;
  font-weight: 700;
  padding: 0.08rem 0.45rem;
  border-radius: 9999px;
  line-height: 1.2;
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.btn-text-add {
  background: transparent;
  border: none;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.btn-text-add:hover {
  color: var(--text-primary);
  background: transparent;
}

/* Inner Scrollable Container (Isolated Scroll) */
.ambitions-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-right: 0.25rem;
}

/* Slim Custom Scrollbar */
.ambitions-scroll-area::-webkit-scrollbar {
  width: 4px;
}

.ambitions-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.ambitions-scroll-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.ambitions-scroll-area::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.ambitions-container {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Ambition Item Card (個人目標カード) */
.ambition-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: default;
}

.ambition-card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-card-hover);
}

.ambition-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.category-tag, .genre-tag {
  font-size: 0.675rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.genre-tag {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border-card);
  transition: all var(--transition-fast);
}

.genre-tag[data-genre*="個人開発"] {
  color: var(--genre-personal);
  background: var(--genre-personal-bg);
  border-color: var(--genre-personal-border);
}

.genre-tag[data-genre*="SaaS"] {
  color: var(--genre-saas);
  background: var(--genre-saas-bg);
  border-color: var(--genre-saas-border);
}

.genre-tag[data-genre*="全体構想"],
.genre-tag[data-genre*="ベンチャー"] {
  color: var(--genre-venture);
  background: var(--genre-venture-bg);
  border-color: var(--genre-venture-border);
}

/* Term/Pillar Badges (短期 / 中期 / 長期 / 未分類) */
.term-badge {
  font-size: 0.675rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.4rem;
  box-sizing: border-box;
  text-align: center;
  border: 1px solid transparent;
  letter-spacing: 0.03em;
  color: #0f172a;
}

.term-badge.term-short {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.term-badge.term-mid {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.term-badge.term-long {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.term-badge.term-unclassified {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.status-badge {
  font-size: 0.675rem;
  font-weight: 500;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.85rem;
  box-sizing: border-box;
  text-align: center;
  gap: 0.25rem;
  border: 1px solid transparent;
}

.status-badge.status-planning {
  background: var(--status-planning-bg);
  color: var(--status-planning-text);
  border-color: var(--status-planning-border);
}

.status-badge.status-progress {
  background: var(--status-progress-bg);
  color: var(--status-progress-text);
  border-color: var(--status-progress-border);
}

.status-badge.status-achieved {
  background: var(--status-achieved-bg);
  color: var(--status-achieved-text);
  border-color: var(--status-achieved-border);
  letter-spacing: 0.04em;
}

.status-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: currentColor;
}

.ambition-card-title {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.ambition-card-desc {
  font-size: 0.725rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ambition-actions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.action-checkpoint {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.725rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.action-checkbox {
  appearance: none;
  width: 13px;
  height: 13px;
  border: 1.5px solid #cbd5e1;
  border-radius: 3px;
  background: #ffffff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
}

.action-checkbox:checked {
  background: #059669;
  border-color: #059669;
}

.action-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 45%;
  left: 50%;
  width: 3px;
  height: 6px;
  border: solid #ffffff;
  border-width: 0 1.5px 1.5px 0;
  transform: translate(-50%, -55%) rotate(45deg);
}

.action-checkpoint.completed span {
  text-decoration: line-through;
  color: var(--text-muted);
}

.ambition-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ambition-target-date {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ambition-card-progress {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.ambition-card-progress-bar {
  width: 40px;
  height: 3.5px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.ambition-card-progress-fill {
  height: 100%;
  background: #334155;
  border-radius: 9999px;
}

/* Empty State */
.empty-ambitions {
  padding: 1.5rem 1rem;
  text-align: center;
  background: #ffffff;
  border: 1px dashed var(--border-card);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.775rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

/* =========================================================
   4. MODALS & TOAST
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  transform: scale(0.97);
  transition: all var(--transition-normal);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-card);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 4px;
}

.modal-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-card);
  background: var(--bg-base);
}

.modal-footer-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
}

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  padding: 0.65rem 1.1rem;
  background: #0f172a;
  color: #ffffff;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: var(--shadow-modal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.2s ease, fadeOut 0.2s forwards 2.6s;
  pointer-events: auto;
}

@keyframes slideIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* =========================================================
   5. TIMELINE & PROJECT PAGES (projects.html / project.html)
   ========================================================= */

/* Timeline Layout Container (100% Viewport Locked) */
.timeline-main-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 1.2vh 1.2vw;
  overflow: hidden;
}

.timeline-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.5rem;
}

.timeline-scroll-area::-webkit-scrollbar {
  width: 5px;
}

.timeline-scroll-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* =========================================================
   5. CHRONOLOGICAL PROJECT LIST (projects.html)
   ========================================================= */
.projects-chrono-view {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  padding: 0.2rem 0.2rem 2rem;
}

/* Legend Header Bar */
.projects-legend-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.75rem;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.projects-legend-items {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.projects-legend-label {
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.projects-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-primary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.projects-chrono-count {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Bullet List Container */
.project-bullet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Single Project Row (箇条書きカード行) */
.project-list-row {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.project-list-row:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

/* Bullet Dot Marker (ジャンル色分け丸) */
.project-bullet-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.project-list-row:hover .project-bullet-marker {
  transform: scale(1.35);
}

.project-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
}

.project-row-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.project-list-row:hover .project-row-title {
  color: #0f172a;
}

.project-row-summary {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Right Side Column (右上ラベル＋右下矢印) */
.project-row-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 0.4rem;
}

/* カード右上：ラベル群 */
.project-row-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* カード右下：矢印 */
.project-row-arrow {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: 0.05rem;
  flex-shrink: 0;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.project-list-row:hover .project-row-arrow {
  color: #2563eb;
  transform: translateX(3px);
}

.timeline-period-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-sans);
}

/* =========================================================
   6. PROJECT DETAIL PAGE (project.html)
   ========================================================= */
.detail-sub-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.2rem;
  height: 32px;
  flex-shrink: 0;
}

.btn-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid var(--border-card);
  transition: all var(--transition-fast);
}

.btn-back-link:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.detail-meta-indicator {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 500;
}

.project-detail-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 1.5vh 2vw;
  overflow: hidden;
}

.project-detail-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.5rem;
}

.project-detail-scroll-area::-webkit-scrollbar {
  width: 5px;
}

.project-detail-scroll-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.project-detail-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-bottom: 2.5rem;
}

/* 1. Hero Header Card (Full Width) */
.detail-hero-header {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1.6rem 2rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-tags-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.detail-period-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 0.2rem;
}

.detail-main-title {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0;
}

.detail-main-summary {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.68;
  margin: 0;
}

/* 2. Content Layout (2-Column: Main Details + Dedicated Links Sidebar) */
.detail-content-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  width: 100%;
}

.detail-main-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-sidebar-column {
  width: 360px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
}

/* Dedicated Links Card */
.detail-links-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1.35rem 1.4rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-links-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-card);
}

.detail-links-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.detail-links-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  background: #f1f5f9;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

.detail-links-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Unified Link & SNS List in Sidebar */
.detail-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.detail-link-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--border-card);
  border-radius: 9px;
  text-decoration: none;
  transition: all 0.18s ease;
}

.detail-link-row-item:hover {
  background: #ffffff;
  border-color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.detail-link-row-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.detail-link-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #475569;
  flex-shrink: 0;
}

.detail-link-row-icon svg {
  width: 15px;
  height: 15px;
}

.detail-link-row-label {
  font-size: 0.835rem;
  color: #0f172a;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-link-row-arrow {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 0.4rem;
  transition: transform 0.18s ease, color 0.18s ease;
}

.detail-link-row-item:hover .detail-link-row-arrow {
  transform: translateX(2px);
  color: #0f172a;
}

.detail-link-row-note {
  font-size: 0.68rem;
  color: #475569;
  background: #e2e8f0;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  font-weight: 500;
  flex-shrink: 0;
  margin-left: 0.4rem;
  white-space: nowrap;
}

/* Detail Section Blocks in Main Column */
.detail-section-block {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1.45rem 1.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.detail-section-block:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.04);
}

.detail-section-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.detail-section-label::before {
  content: '';
  display: inline-block;
  width: 3.5px;
  height: 15px;
  background: #334155;
  border-radius: 2px;
}

.detail-section-content {
  font-size: 0.9rem;
  line-height: 1.75;
  color: #334155;
  margin: 0;
}

.detail-not-found {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .detail-content-layout {
    flex-direction: column-reverse;
  }
  .detail-sidebar-column {
    width: 100%;
    position: static;
  }
}

/* =========================================================
   7. SNS MATRIX PAGE (sns.html)
   ========================================================= */
.matrix-main-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 1.2vh 1.2vw;
  overflow: hidden;
}

.matrix-scroll-area {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.matrix-scroll-area::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.matrix-scroll-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Matrix Table Card */
.matrix-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.matrix-card-header {
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.matrix-card-title {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.matrix-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.matrix-table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.matrix-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

.matrix-table th,
.matrix-table td {
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--border-card);
  border-right: 1px solid var(--border-card);
  vertical-align: middle;
  box-sizing: border-box;
}

.matrix-table th:last-child,
.matrix-table td:last-child {
  border-right: none;
}

/* Table Header - Proportionally allocated: Project 16%, 8 Platforms 10.5% each (total 100%) */
.matrix-table thead th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--text-primary);
  position: sticky;
  top: 0;
  z-index: 3;
  font-size: 0.72rem;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.6rem 0.2rem;
}

.matrix-table thead th.th-project {
  width: 16%;
  text-align: left;
  padding-left: 0.6rem;
  background: #f8fafc;
}

.matrix-table thead th.th-platform {
  width: 10.5%;
  text-align: center;
}

/* Project Row & Cells */
.matrix-row:hover {
  background: #f8fafc;
}

.td-project {
  width: 16%;
  background: #ffffff;
  padding-left: 0.6rem !important;
  padding-right: 0.35rem !important;
}

.matrix-row:hover .td-project {
  background: #f8fafc;
}

.project-meta-compact {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
}

.project-name-link {
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1.25;
  transition: color var(--transition-fast);
  white-space: normal;
  word-break: break-word;
}

.project-name-link:hover {
  color: #2563eb;
}

.project-badges-sub {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

/* Matrix Cell Content */
.matrix-cell {
  width: 10.5%;
  text-align: center;
  background: #ffffff;
  padding: 0.4rem 0.15rem;
  transition: background-color var(--transition-fast);
}

.matrix-row:hover .matrix-cell {
  background: #f8fafc;
}

.matrix-cell-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
}

/* Status Badges in Matrix */
.matrix-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.matrix-status-active {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.matrix-status-preparing {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.matrix-status-done {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.matrix-status-planning {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

.matrix-status-none {
  background: transparent;
  color: #cbd5e1;
  font-weight: 400;
  font-size: 0.75rem;
}

/* Account Role Badges */
.matrix-role-income {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.matrix-role-expense {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.matrix-role-main {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.matrix-role-pool {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #c7d2fe;
}

.matrix-role-credit {
  background: #f0fdfa;
  color: #0f766e;
  border-color: #99f6e4;
}

.matrix-account-type {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
}

.matrix-cell-note {
  font-size: 0.675rem;
  color: var(--text-secondary);
  line-height: 1.3;
  max-width: 140px;
  text-align: center;
  word-break: break-word;
}

.matrix-cell-account {
  font-size: 0.675rem;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
}

/* SNS Icon Buttons in Matrix Cells */
.matrix-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #ffffff;
  color: #64748b;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  flex-shrink: 0;
}

.matrix-icon-btn svg {
  width: 14px;
  height: 14px;
}

.matrix-icon-btn:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  transform: translateY(-1.5px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
}

.matrix-icon-note {
  font-size: 0.62rem;
  line-height: 1.15;
  color: var(--text-tertiary);
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  display: block;
}

/* Responsive adjustment for small screens to prevent swipe/overflow */
@media (max-width: 768px) {
  .matrix-table thead th {
    font-size: 0.65rem;
    padding: 0.4rem 0.1rem;
  }
  .matrix-table thead th.th-project,
  .td-project {
    width: 28%;
    padding-left: 0.4rem !important;
  }
  .matrix-table thead th.th-platform,
  .matrix-cell {
    width: 9%;
  }
  .matrix-icon-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
  }
  .matrix-icon-btn svg {
    width: 12px;
    height: 12px;
  }
  .matrix-icon-note {
    font-size: 0.58rem;
  }
}

/* Platform Strategy Summary Section */
.platform-cards-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.section-caption-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.platform-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.platform-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 0.75rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.platform-card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-card-hover);
}

.platform-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.platform-card-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.platform-card-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* =========================================================
   8. SNS AI AUTOMATION & STEALTH MARKETING (sns-automation.html)
   ========================================================= */

/* AI Automation Action Column in Matrix (sns.html) */
.matrix-table thead th.th-automation {
  width: 8%;
  text-align: center;
  color: var(--text-primary);
  background: #f8fafc;
}

.matrix-cell-action {
  width: 8%;
  text-align: center;
}

.matrix-automation-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #ffffff;
  color: #64748b;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  flex-shrink: 0;
}

.matrix-automation-btn:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  transform: translateY(-1.5px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
}

.matrix-automation-btn svg {
  width: 14px;
  height: 14px;
}

/* SNS Automation Page Container */
.auto-main-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 0.7vh 1vw;
  overflow: hidden;
}

.auto-scroll-area {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.auto-scroll-area::-webkit-scrollbar {
  width: 5px;
}

.auto-scroll-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Header Banner */
.auto-header-banner {
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 0.85rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.auto-header-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.auto-header-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auto-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.auto-badge-stealth {
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
  font-size: 0.675rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
}

.auto-accounts-tags {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.auto-acc-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Main Studio Layout: Generator & Previews (1画面ロック) */
.auto-studio-grid {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 1rem;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .auto-studio-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}


/* Generator Panel Card */
.auto-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.auto-card-header {
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auto-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.auto-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* Form Controls */
.auto-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auto-field-label {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.auto-select,
.auto-input,
.auto-textarea {
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.auto-select:focus,
.auto-input:focus,
.auto-textarea:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.auto-presets-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.auto-preset-chip {
  font-size: 0.675rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.auto-preset-chip:hover {
  background: #f1f5f9;
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.auto-preset-chip.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  font-weight: 600;
}

.auto-generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.825rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.15);
  transition: all 0.2s ease;
  margin-top: 0.3rem;
}

.auto-generate-btn:hover {
  background: #334155;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}

.auto-generate-btn:active {
  transform: translateY(0);
}

/* 3-SNS Preview Grid */
.auto-previews-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.auto-previews-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auto-previews-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.auto-previews-tabs {
  display: flex;
  gap: 0.35rem;
}

.auto-tab-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.725rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-card);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition-fast);
}

.auto-tab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.auto-tab-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.auto-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

@media (max-width: 1200px) {
  .auto-cards-row {
    grid-template-columns: 1fr;
  }
}

/* Individual Platform Preview Card */
.platform-preview-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.platform-preview-card:hover {
  border-color: var(--border-highlight);
}

.preview-card-header {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafbfc;
}

.preview-card-platform {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-primary);
}

.preview-card-actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.preview-action-btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.675rem;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid var(--border-card);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all var(--transition-fast);
}

.preview-action-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.preview-action-btn.btn-copy:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.preview-action-btn.btn-post {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.preview-action-btn.btn-post:hover {
  background: #334155;
  border-color: #334155;
}

.preview-card-body {
  padding: 0.85rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.preview-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.preview-text-box {
  width: 100%;
  min-height: 120px;
  padding: 0.6rem;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  line-height: 1.45;
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  background: #fdfdfd;
  resize: vertical;
}

.preview-text-box:focus {
  outline: none;
  border-color: #0f172a;
  background: #ffffff;
}

.preview-meta-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.7rem;
}

.preview-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
}

.preview-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.preview-tag {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 500;
}

/* Schedule & Pipeline Table */
.auto-pipeline-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.pipeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.pipeline-table th,
.pipeline-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border-card);
  text-align: left;
}

.pipeline-table th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.pipeline-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
}

.status-scheduled {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
}

.status-published {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.status-draft {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* ==========================================================================
   Carousel Canvas Integration & Studio Enhancements
   ========================================================================== */

/* 曜日セレクター */
.day-selector-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.day-selector-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.35rem;
  background: #ffffff;
  border: 1.5px solid var(--border-card);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: center;
}

.day-selector-btn:hover {
  border-color: #0f172a;
  background: #f8fafc;
}

.day-selector-btn.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.day-btn-badge {
  font-size: 0.65rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.day-btn-target {
  font-size: 0.72rem;
  font-weight: 800;
}

.day-selector-btn.active .day-btn-badge {
  color: #94a3b8;
}

.day-selector-btn.active .day-btn-target {
  color: #ffffff;
}

/* 文字数カウンター */
.char-counter-container {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
}

.char-counter-safe {
  color: var(--text-secondary);
}

.char-counter-warning {
  color: #ef4444;
  font-weight: 700;
}

/* キャンバス作業ステージ */
.canvas-stage-wrapper {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  cursor: grab;
  user-select: none;
}

.canvas-stage-wrapper.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.canvas-stage-wrapper::-webkit-scrollbar {
  height: 8px;
}

.canvas-stage-wrapper::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 4px;
}

.canvas-stage-wrapper::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
  transition: background 0.2s;
}

.canvas-stage-wrapper::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.canvas-track-container {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  height: 100%;
  width: max-content;
  padding-bottom: 0.25rem;
}

/* 背景画像切り替えセレクター（モダン・セグメントコントロール） */
.bg-selector-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.2rem;
  border-radius: 9999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bg-selector-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.74rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  user-select: none;
  line-height: 1.2;
}

.bg-selector-btn:hover {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.6);
}

.bg-selector-btn.active {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  font-weight: 700;
}


/* スケール表示用ラッパー（画面の高さ割合で定義。アスペクト比 1080:1350 = 4:5） */
:root {
  --card-h: clamp(380px, calc(100vh - 160px), 720px);
  --card-w: calc(var(--card-h) * 0.8);
  --card-scale-num: calc(var(--card-h) / 1350);
}

.canvas-scale-box {
  width: var(--card-w);
  height: var(--card-h);
  position: relative;
  flex-shrink: 0;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  background: #ffffff;
  overflow: hidden;
}

/* 1080x1350 カルーセルキャンバス本体（AI生成クローバー背景＋ガーリーデコ） */
.post-canvas {
  width: 1080px;
  height: 1350px;
  background-color: #faf9f5;
  background-image: url('../assets/design/bg-clover-girly.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #111827;
  position: absolute;
  top: 0;
  left: 0;
  transform: scale(var(--card-scale-num, 0.35));
  transform-origin: top left;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  user-select: none;
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
  overflow: hidden;
}


/* スライド番号バッジ（右上 TikTokスタイル） */
.canvas-slide-num {
  display: none !important;
  position: absolute;
  top: 36px;
  right: 36px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  color: var(--text-secondary);
  font-size: 24px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  letter-spacing: 0.05em;
  z-index: 10;
}

/* 表紙・エンディング：中央配置コンテナ */
.canvas-cover-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  padding: 60px 48px;
  box-sizing: border-box;
  text-align: center;
}

/* 白ハイライトタイトル帯（表紙） */
.cover-highlight-title {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px 36px;
  font-size: 40px;
  font-weight: 900;
  color: #111111;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  line-height: 1.4;
  display: inline-block;
  letter-spacing: 0.02em;
  width: 90%;
  max-width: 900px;
  box-sizing: border-box;
  word-break: break-word;
  text-align: center;
}

/* 表紙の仕切りデコタグ */
.cover-deco-tag {
  background: #ffffff;
  border-radius: 10px;
  padding: 8px 36px;
  font-size: 28px;
  font-weight: 800;
  color: #555555;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  display: inline-block;
  margin-top: 26px;
  letter-spacing: 0.12em;
}

/* アプリ紹介（1枚に2アプリ上下配置）レイアウト */
.app-pair-layout {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  height: 100%;
  width: 100%;
  padding: 60px 40px;
  box-sizing: border-box;
}

/* 各アプリの縦積みユニット */
.app-pair-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 920px;
}

/* アプリ名バッジ（白角丸） */
.app-badge-name {
  background: #ffffff;
  border-radius: 10px;
  padding: 8px 32px;
  font-size: 32px;
  font-weight: 900;
  color: #111111;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  letter-spacing: 0.03em;
}

/* アプリアイコン（中央大きめ） */
.app-icon-center {
  width: 184px;
  height: 184px;
  border-radius: 44px;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
  background: #ffffff;
  transition: transform 0.2s;
}

/* 白ハイライト推薦テキスト帯 */
.app-comment-banner {
  background: #ffffff;
  border-radius: 12px;
  padding: 22px 36px;
  width: 92%;
  max-width: 880px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  text-align: center;
  box-sizing: border-box;
}

/* 感情フック見出し（1行目） */
.app-hook-text {
  font-size: 34px;
  font-weight: 900;
  color: #111111;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

/* 推薦詳細文（2〜3行目・ぎゅっと詰まった行間） */
.app-detail-text {
  font-size: 26px;
  font-weight: 700;
  color: #262626;
  line-height: 1.28;
  letter-spacing: -0.01em;
  margin: 0;
}

.app-card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.app-category-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 23px;
  font-weight: 800;
  padding: 5px 18px;
  border-radius: 16px;
}

.badge-pink   { background: #fdf2f8; color: #db2777; }
.badge-green  { background: #f0fdf4; color: #16a34a; }
.badge-blue   { background: #f0f9ff; color: #0284c7; }
.badge-purple { background: #faf5ff; color: #7c3aed; }

.app-card-catch {
  font-size: 30px;
  font-weight: 900;
  color: #111827;
  line-height: 1.25;
  margin: 0;
}

.app-card-desc {
  font-size: 22px;
  font-weight: 600;
  color: #4b5563;
  line-height: 1.35;
  margin: 0;
}

/* 旧互換スタイル */
.app-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.app-block-icon {
  width: 180px;
  height: 180px;
  border-radius: 40px;
  border: 12px solid #ffffff;
  box-shadow: 0 10px 28px rgba(0,0,0,0.15);
  object-fit: cover;
  background: #ffffff;
}
.app-block-name {
  font-size: 34px;
  font-weight: 900;
  color: #111111;
  text-align: center;
  margin: 0;
}
.app-block-desc {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 22px;
  padding: 20px 32px;
  font-size: 26px;
  font-weight: 700;
  color: #333333;
  text-align: center;
  line-height: 1.25;
  width: 88%;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.pill-tag {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 50px;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
}
.pill-yellow { background: #fef08a; color: #713f12; }
.pill-pink   { background: #fce7f3; color: #831843; }
.pill-blue   { background: #dbeafe; color: #1e40af; }

/* キャンバス操作ツールバー */
.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.canvas-toolbar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.canvas-scale-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
}



/* ==========================================================================
   SNS Automation Studio — 追加スタイル
   ========================================================================== */

/* 無効化されたボタンを見た目でも伝える（従来は :disabled のスタイルが無かった） */
.auto-generate-btn:disabled,
.preview-action-btn:disabled,
.day-selector-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.auto-generate-btn:disabled:hover,
.preview-action-btn:disabled:hover,
.day-selector-btn:disabled:hover {
  background: inherit;
  transform: none;
  box-shadow: none;
}

/* 送信中スピナー（従来はクラスだけ付いて定義が無かった） */
@keyframes auto-spin {
  to { transform: rotate(360deg); }
}

.spin-icon {
  animation: auto-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .spin-icon { animation-duration: 2.4s; }
}

/* 一部成功ステータス */
.status-partial {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* 配信設定フォーム */
.auto-text-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.auto-text-input:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.auto-help-text {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  line-height: 1.45;
}

.auto-help-text code {
  font-size: 0.66rem;
  padding: 0 0.2rem;
  border-radius: 3px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

/* 広告明示（ステマ規制）の注意書き */
.auto-promo-notice {
  margin-top: 0.4rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.45;
}

/* 文字数超過の警告 */
.char-count-warning {
  font-size: 0.68rem;
  color: #ef4444;
  font-weight: 700;
  line-height: 1.45;
}

/* プレビューカードのプラットフォーム別カウンター */
.preview-count-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.3rem;
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
}

.preview-count-ok {
  color: var(--text-tertiary);
}

.preview-count-over {
  color: #ef4444;
  font-weight: 700;
}

/* 配信ログ */
.log-channel-tag {
  display: inline-block;
  padding: 1px 5px;
  margin-right: 2px;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  font-size: 0.65rem;
}

/* ==========================================================================
/* ==========================================================================
   Studio Unified Right Panel System & Studio Modal
   ========================================================================== */

.studio-panel-column {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  height: 100%;
  min-height: 0;
  justify-content: space-between;
}

.studio-control-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.studio-control-card:hover {
  border-color: rgba(203, 213, 225, 0.95);
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.07);
}

.studio-control-card.studio-card-fill {
  flex: 1;
  min-height: 0;
}

.studio-card-header {
  padding: 0.4rem 0.8rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.studio-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.studio-card-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0;
}

.studio-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.08rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.25;
}

.studio-status-pill.pill-active {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.studio-status-pill.pill-active::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
}

.studio-status-pill.pill-muted {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.studio-link-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.studio-link-btn:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-primary);
}

.studio-card-body {
  padding: 0.55rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.studio-body-fill {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* チャンネルピルタグ */
.studio-channels-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.studio-channel-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
}

.studio-account-name {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-left: auto;
  font-family: var(--font-mono, monospace);
  font-weight: 500;
}

/* ボタン統一システム */
.studio-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.studio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.52rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  white-space: nowrap;
  border: 1px solid transparent;
  user-select: none;
}

.studio-btn:active {
  transform: scale(0.97);
}

.studio-btn-primary {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  box-shadow: 0 2px 5px -1px rgba(15, 23, 42, 0.25), 0 1px 2px -1px rgba(15, 23, 42, 0.15);
}

.studio-btn-primary:hover {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  box-shadow: 0 4px 10px -2px rgba(15, 23, 42, 0.3);
  transform: translateY(-1px);
}

.studio-btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.studio-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
}

.studio-btn-full {
  width: 100%;
}

.studio-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.studio-textarea {
  flex: 1;
  min-height: 80px;
  height: 100%;
  line-height: 1.6;
  font-size: 0.82rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.7rem;
  resize: none;
  font-family: inherit;
  color: #1e293b;
  background: #ffffff;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.studio-textarea:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   Studio Modal System (洗練されたガラス風・角丸・高品位UI)
   ========================================================================== */

.studio-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.studio-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.studio-modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 820px;
  max-height: 86vh;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(8px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.studio-modal-overlay.active .studio-modal-card {
  transform: scale(1) translateY(0);
}

.studio-modal-header {
  padding: 1.1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}

.studio-modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.studio-modal-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.studio-modal-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin: 0;
}

.studio-modal-subtitle {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
  display: block;
  margin-top: 0.15rem;
}

.studio-modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.studio-modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: rotate(90deg);
}

.studio-modal-body {
  padding: 1.15rem 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1;
}

.studio-modal-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 100%);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.studio-modal-banner-content {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.76rem;
  color: #166534;
  font-weight: 500;
  line-height: 1.45;
}

.studio-modal-banner-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.studio-modal-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  background: #ffffff;
  border: 1px solid #86efac;
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #15803d;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.studio-modal-banner-btn:hover {
  background: #f0fdf4;
  border-color: #22c55e;
  transform: translateY(-1px);
}

.studio-modal-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  max-height: 48vh;
  overflow-y: auto;
}

.studio-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: left;
}

.studio-modal-table thead th {
  background: #f8fafc;
  padding: 0.65rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  letter-spacing: 0.02em;
}

.studio-modal-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.studio-modal-table tbody tr:last-child {
  border-bottom: none;
}

.studio-modal-table tbody tr:hover {
  background: #f8fafc;
}

.studio-modal-table tbody td {
  padding: 0.65rem 0.85rem;
  vertical-align: middle;
}

.studio-modal-footer {
  padding: 0.85rem 1.4rem;
  background: #fafbfc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.studio-modal-danger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #ef4444;
  background: #fef2f2;
  border: 1px solid #fecaca;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.studio-modal-danger-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* 投稿日時指定予約（常時表示エリア） */
.studio-schedule-section {
  display: flex;
  flex-direction: column;
  margin-top: 0.1rem;
}

.studio-schedule-input-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.studio-datetime-input {
  flex: 1;
  min-width: 0;
  padding: 0.42rem 0.55rem;
  font-size: 0.74rem;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.studio-datetime-input:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

/* 配信履歴テーブルの予約日時 vs 投稿日時バッジ */
.badge-time-direct {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-time-scheduled {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.badge-time-queue {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

/* 無料枠・クォータ監視カード */
.quota-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.quota-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  white-space: nowrap;
}

.quota-item-name {
  font-weight: 700;
  color: #334155;
  font-size: 0.7rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.quota-item-metric {
  color: #64748b;
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.quota-bar-wrap {
  width: 100%;
  height: 4px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
}

.quota-bar {
  height: 100%;
  background: #10b981;
  border-radius: 9999px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.quota-bar.warning {
  background: #f59e0b;
}

.quota-bar.danger {
  background: #ef4444;
}

.studio-header-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.studio-header-link {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.studio-header-link:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
  text-decoration: none;
}

