/**
 * public/styles.css
 * ひいブランドカラー（ボルドー #7B1E2D × ゴールド #C9A227 × オフホワイト #FBF7F0）
 * PC＆スマホ完全レスポンシブ対応
 */
:root {
  --bordeaux: #7B1E2D;
  --bordeaux-dark: #58121E;
  --bordeaux-soft: #FDF2F4;
  --gold: #C9A227;
  --gold-light: #F6EBD1;
  --gold-dark: #9E7B12;
  --bg-cream: #FBF7F0;
  --bg-card: #FFFFFF;
  --text-main: #2A1E21;
  --text-sub: #665659;
  --border-warm: #E8DEC8;
  --green-ok: #1B7F4E;
  --green-bg: #E7F7EF;
  --amber-warn: #B26A00;
  --amber-bg: #FFF4E0;
  --red-ng: #C62828;
  --red-bg: #FDECEA;
  --shadow-soft: 0 8px 24px rgba(123, 30, 45, 0.07);
  --radius-lg: 16px;
  --radius-md: 10px;
}

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

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-cream);
  color: var(--text-main);
  line-height: 1.65;
  padding-bottom: 60px;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

/* ログインモーダル（クラウド・スマホアクセス時） */
.login-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(42, 14, 20, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.login-modal-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--bordeaux);
  margin: 12px 0 8px;
}

.login-modal-desc {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin-bottom: 18px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border-warm);
  border-radius: 10px;
  font-size: 1rem;
  text-align: center;
}

.login-input:focus {
  outline: none;
  border-color: var(--bordeaux);
}

.login-error-msg {
  color: var(--red-ng);
  background: var(--red-bg);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.login-submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}

/* ヒーローヘッダー（エディトリアル・ラグジュアリー仕様） */
.hero-header {
  background: linear-gradient(145deg, #1B1317 0%, #2D1A22 55%, #3B202B 100%);
  color: #FFFFFF;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 10px 30px rgba(24, 14, 18, 0.16);
}

.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
}

.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 8px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(226, 196, 120, 0.38);
  color: #F3DFB4;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #E2C478;
  box-shadow: 0 0 8px rgba(226, 196, 120, 0.8);
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.last-updated {
  font-size: 0.71rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.btn-header-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFDF9;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn-header-pill.subtle {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.75);
}

.hero-title {
  font-size: clamp(1.15rem, 3.2vw, 1.68rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  line-height: 1.3;
  color: #FFFDF9;
}

.hero-story {
  font-size: 0.88rem;
  color: rgba(255, 250, 245, 0.88);
  background: rgba(255, 255, 255, 0.06);
  border-left: 3px solid #E2C478;
  padding: 10px 14px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 14px;
}

.hero-story strong {
  color: #F5E0A9;
}

/* セクションナビ（一体型グラスモーフィズム・バー） */
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
  border-radius: 11px;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.78rem;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.nav-pill.active-nav,
.nav-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

/* メインコンテナ */
.main-container {
  width: 100%;
  max-width: 1240px;
  margin: 24px auto 0;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.section-block {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 640px) {
  .section-block {
    padding: 18px 15px;
  }
}

.section-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--gold-light);
}

.section-kicker {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--gold-dark);
  letter-spacing: 0.08em;
}

.section-title {
  font-size: clamp(1.15rem, 2.8vw, 1.35rem);
  color: var(--bordeaux);
  font-weight: 800;
}

.section-sub-hint {
  font-size: 0.82rem;
  color: var(--text-sub);
  background: var(--bg-cream);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-warm);
}

.section-lead {
  font-size: 0.92rem;
  color: var(--text-sub);
  margin-bottom: 16px;
}

/* カテゴリ絞り込みタブ */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.cat-tab {
  background: var(--bg-cream);
  color: var(--text-main);
  border: 1.5px solid var(--border-warm);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 800;
  transition: all 0.16s ease;
}

.cat-tab:hover {
  border-color: var(--gold);
}

.cat-tab.active {
  background: var(--bordeaux);
  color: #FFFFFF;
  border-color: var(--bordeaux);
  box-shadow: 0 4px 10px rgba(123, 30, 45, 0.22);
}

/* ステータスバッジ */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 800;
}

.status-healthy {
  background: var(--green-bg);
  color: var(--green-ok);
  border: 1px solid #A8E0C3;
}

.status-warning {
  background: var(--amber-bg);
  color: var(--amber-warn);
  border: 1px solid #F5D08A;
}

.status-critical {
  background: var(--red-bg);
  color: var(--red-ng);
  border: 1px solid #F3B5B0;
}

/* サイトカードグリッド */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 18px;
  min-width: 0;
}

@media (max-width: 900px) {
  .sites-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.site-card {
  min-width: 0;
  max-width: 100%;
  border: 2px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 18px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-card:hover {
  border-color: var(--gold);
  box-shadow: 0 10px 24px rgba(123, 30, 45, 0.1);
}

.site-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.site-cat-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.site-category {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--bordeaux);
  background: var(--bordeaux-soft);
  padding: 2px 9px;
  border-radius: 999px;
}

.site-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold-dark);
  background: var(--gold-light);
  padding: 2px 9px;
  border-radius: 999px;
}

.site-name {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-main);
}

.site-desc {
  font-size: 0.87rem;
  color: var(--text-sub);
  margin-top: 4px;
}

/* サブリンク（quickLinks）チップ群 */
.quick-links-box {
  background: #FDFBF7;
  border: 1px solid var(--border-warm);
  border-radius: 10px;
  padding: 10px 12px;
}

.quick-links-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--bordeaux);
  margin-bottom: 7px;
}

.quick-links-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  background: #FFFFFF;
  color: var(--bordeaux-dark);
  border: 1px solid #DECBA4;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.quick-link-chip:hover {
  background: var(--gold-light);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.site-meta-box {
  background: var(--bg-cream);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.8rem;
  color: var(--text-sub);
  border-left: 3px solid var(--gold);
  word-break: break-all;
}

.site-meta-box div + div {
  margin-top: 4px;
}

.site-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

/* パート02: メモリダッシュボード */
.memory-section {
  border-top: 5px solid var(--gold);
}

.memory-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .memory-dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.memory-main-card {
  min-width: 0;
  max-width: 100%;
  background: linear-gradient(180deg, #FFFDF9 0%, #FAF3E6 100%);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 18px;
}

.memory-numbers-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.mem-stat-box {
  flex: 1;
  min-width: 150px;
}

.mem-stat-label {
  font-size: 0.82rem;
  color: var(--text-sub);
  font-weight: 700;
}

.mem-stat-value {
  font-size: 2.15rem;
  font-weight: 900;
  color: var(--bordeaux);
  line-height: 1.15;
}

.mem-stat-value small {
  font-size: 1rem;
}

.mem-stat-value-sub {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 6px;
}

.meter-track {
  height: 15px;
  background: #E9E1D4;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bordeaux) 0%, var(--gold) 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.meter-caption {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 14px;
}

.memory-cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.trim-result-pop {
  background: var(--green-bg);
  color: var(--green-ok);
  border: 1px solid #9ADBB9;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.88rem;
}

.memory-side-card {
  min-width: 0;
  max-width: 100%;
  background: #FCF9F4;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-card-title {
  font-size: 0.94rem;
  color: var(--bordeaux);
  font-weight: 800;
}

.process-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proc-tag {
  background: #FFFFFF;
  border: 1px solid var(--border-warm);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.79rem;
  font-weight: 700;
}

.proc-tag strong {
  color: var(--bordeaux);
}

.guard-log-box {
  background: #24181B;
  color: #F6EBD1;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: Consolas, monospace;
  font-size: 0.75rem;
}

.guard-log-header {
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}

.guard-log-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* パート03: 黄金プロンプト集 */
.prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  min-width: 0;
}

.prompt-card {
  min-width: 0;
  max-width: 100%;
  background: linear-gradient(180deg, #FFFFFF 0%, #FDFBF7 100%);
  border: 1px solid var(--border-warm);
  border-top: 4px solid var(--bordeaux);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.prompt-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  color: #FFFFFF;
  background: var(--bordeaux);
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.prompt-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
}

.prompt-summary {
  font-size: 0.84rem;
  color: var(--text-sub);
}

.prompt-preview {
  background: #F4EFE6;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.79rem;
  color: #3E3033;
  white-space: pre-wrap;
  max-height: 110px;
  overflow-y: auto;
  border: 1px dashed #D5C7AD;
}

/* パート04: Obsidian直結メモ＆フォーカス */
.obsidian-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .obsidian-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.memo-card,
.focus-card {
  min-width: 0;
  max-width: 100%;
  background: #FCF9F4;
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 18px;
}

.subpanel-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--bordeaux);
  margin-bottom: 12px;
}

.memo-form {
  margin-bottom: 16px;
}

.memo-form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.memo-select {
  padding: 10px 12px;
  border: 1px solid var(--border-warm);
  border-radius: 8px;
  background: #FFFFFF;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.memo-input {
  flex: 1;
  min-width: 180px;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-warm);
  border-radius: 8px;
  font-size: 1rem;
}

.memos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
}

.memo-item {
  background: #FFFFFF;
  border: 1px solid var(--border-warm);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.memo-item-cat {
  font-size: 0.74rem;
  font-weight: 800;
  background: var(--gold-light);
  color: var(--bordeaux-dark);
  padding: 2px 8px;
  border-radius: 6px;
  margin-right: 6px;
}

.memo-item-time {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.memo-item-text {
  margin-top: 4px;
  font-size: 0.91rem;
  word-break: break-word;
}

.focus-caption {
  font-size: 0.83rem;
  color: var(--text-sub);
  margin-bottom: 12px;
}

.focus-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.focus-sec {
  background: #FFFFFF;
  border: 1px solid var(--border-warm);
  border-left: 4px solid var(--bordeaux);
  border-radius: 8px;
  padding: 10px 14px;
}

.focus-sec-title {
  font-size: 0.89rem;
  font-weight: 800;
  color: var(--bordeaux);
  margin-bottom: 4px;
}

.focus-sec-items {
  font-size: 0.82rem;
  color: var(--text-sub);
  padding-left: 16px;
}

/* ボタン共通 */
button,
.btn-link {
  cursor: pointer;
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 800;
  border-radius: 8px;
  padding: 9px 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.16s ease;
  border: none;
}

.btn-gold-cta {
  background: linear-gradient(135deg, #DFB73C 0%, var(--gold) 100%);
  color: var(--bordeaux-dark);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.35);
  font-size: 0.92rem;
  padding: 11px 18px;
}

.btn-gold-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.btn-bordeaux {
  background: var(--bordeaux);
  color: #FFFFFF;
}

.btn-bordeaux:hover {
  background: var(--bordeaux-dark);
}

.btn-outline-bordeaux {
  background: #FFFFFF;
  color: var(--bordeaux);
  border: 1.5px solid var(--bordeaux);
}

.btn-outline-bordeaux:hover {
  background: var(--bordeaux-soft);
}

.btn-outline-gold {
  background: rgba(255, 255, 255, 0.12);
  color: #FFE89E;
  border: 1px solid var(--gold);
}

.btn-outline-gold:hover {
  background: rgba(201, 162, 39, 0.3);
}

.btn-delete-mini {
  background: transparent;
  color: var(--text-sub);
  border: 1px solid var(--border-warm);
  padding: 4px 9px;
  font-size: 0.75rem;
}

.btn-delete-mini:hover {
  background: var(--red-bg);
  color: var(--red-ng);
  border-color: var(--red-ng);
}

/* トースト通知 */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: 20px;
  pointer-events: none;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.toast {
  pointer-events: auto;
  max-width: 460px;
  background: var(--bordeaux-dark);
  color: #FFFFFF;
  border-left: 5px solid var(--gold);
  padding: 13px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  font-weight: 700;
  font-size: 0.9rem;
  animation: slideIn 0.2s ease-out;
}

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

.site-footer {
  text-align: center;
  margin-top: 40px;
  color: var(--text-sub);
  font-size: 0.82rem;
  padding: 0 16px;
}


/* パート00: Antigravity＆Claude＆ChatGPT 進行中チャット 遠隔リモコン（スマホ縦型＆3大エンジンカラー完全対応） */
.remote-chats-section {
  border-top: 3px solid #2D1A22;
}

.remote-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-warm);
}

.remote-top-titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.remote-header-controls {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.auto-poll-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F6F3EE;
  border: 1px solid #DFD5C5;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #3D2B30;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.auto-poll-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9CA3AF;
  transition: all 0.2s ease;
}

.auto-poll-toggle input:checked + .live-pulse-dot {
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.btn-refresh-mini {
  background: #F6F3EE;
  border: 1px solid #DFD5C5;
  color: #3D2B30;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.btn-refresh-mini:hover {
  background: var(--bordeaux-soft);
  border-color: var(--bordeaux);
}

/* Antigravity / Claude / ChatGPT 4セグメント切替コントロール */
.chat-engine-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
  width: 100%;
  min-width: 0;
  background: #F4EFE7;
  padding: 5px;
  border-radius: 13px;
  border: 1px solid #E5DCCB;
}

.engine-tab-btn {
  min-width: 0;
  width: 100%;
  background: transparent;
  color: #544649;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 7px 4px;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: none;
}

.engine-tab-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.engine-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.engine-dot.all {
  background: #C9A227;
}

.engine-dot.agy {
  background: #6D28D9;
}

.engine-dot.claude {
  background: #D97706;
}

.engine-dot.chatgpt {
  background: #0D9488;
}

.engine-tab-btn.active .engine-dot {
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.engine-tab-count {
  background: rgba(0, 0, 0, 0.07);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.69rem;
  line-height: 1.25;
}

.engine-tab-btn.active {
  background: #2B1B22;
  color: #FFFFFF;
  border-color: #2B1B22;
  box-shadow: 0 3px 10px rgba(30, 18, 23, 0.18);
}

.engine-tab-btn.active .engine-tab-count {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.engine-tab-btn.agy-tab.active {
  background: linear-gradient(135deg, #5B21B6 0%, #4C1D95 100%);
  border-color: #4C1D95;
}

.engine-tab-btn.claude-tab.active {
  background: linear-gradient(135deg, #B45309 0%, #92400E 100%);
  border-color: #92400E;
}

.engine-tab-btn.chatgpt-tab.active {
  background: linear-gradient(135deg, #0F766E 0%, #115E59 100%);
  border-color: #115E59;
}

.btn-new-chatgpt-pill {
  background: #FFFFFF;
  color: #0F766E;
  border: 1px solid #99F6E4;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.08);
}

.btn-new-chatgpt-pill:hover {
  background: #F0FDFA;
}

.remote-chats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.3fr);
  gap: 20px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.chat-list-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: #FAF8F5;
  border: 1px solid #E7DFD3;
  border-radius: var(--radius-md);
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.chat-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  font-weight: 800;
  color: #2B1B22;
  font-size: 0.82rem;
  padding: 2px 2px 10px;
}

.chat-list-header.all-mode {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.chat-list-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

#chat-list-header-title {
  white-space: nowrap;
}

.chat-list-header.all-mode .chat-list-header-left {
  justify-content: space-between;
  width: 100%;
}

.chat-count-pill {
  background: #EFE9DF;
  color: #5A4B4E;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.active-chats-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 620px;
  overflow-y: auto;
  width: 100%;
  min-width: 0;
}

.chat-item-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #FAF7FF 100%);
  border: 1px solid #E4DCFA;
  border-left: 4px solid #6D28D9;
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-weight: 400;
  box-shadow: 0 2px 8px rgba(30, 20, 24, 0.03);
}

.chat-item-card.engine-claude {
  background: linear-gradient(135deg, #FFFFFF 0%, #FFF9F4 100%);
  border-color: #F4DFCC;
  border-left-color: #D97706;
}

.chat-item-card.engine-chatgpt {
  background: linear-gradient(135deg, #FFFFFF 0%, #F4FBF9 100%);
  border-color: #CCEAE3;
  border-left-color: #0D9488;
}

.chat-item-card:hover {
  border-color: #C9A227;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(30, 20, 24, 0.07);
}

.chat-item-card.active {
  border-color: #2B1B22;
  background: #FFFCFA;
  box-shadow: 0 6px 18px rgba(43, 27, 34, 0.12);
}

.chat-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.chat-item-badges {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}

.chat-engine-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 2px 8px;
  border-radius: 6px;
  background: #F5F0FF;
  color: #5B21B6;
  border: 1px solid #E4D7FE;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-engine-tag.claude {
  background: #FFF7ED;
  color: #9A3412;
  border-color: #FED7AA;
}

.chat-engine-tag.chatgpt {
  background: #F0FDFA;
  color: #115E59;
  border-color: #B2F5EA;
}

.chat-topic-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: #706064;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #706064;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.ready {
  background: #10B981;
}

.status-dot.busy {
  background: #F59E0B;
}

.meta-sep {
  color: #C4B8AC;
}

.chat-rel-time {
  font-size: 0.7rem;
  font-weight: 700;
  color: #5C4B4F;
  white-space: nowrap;
}

.chat-item-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.chat-item-title {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: #23181B;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-mark {
  color: #C9A227;
  margin-right: 4px;
  font-size: 0.82rem;
}

.chat-chevron {
  font-size: 1.15rem;
  font-weight: 700;
  color: #B6A69B;
  line-height: 1;
  flex-shrink: 0;
}

.chat-item-dialogue {
  width: 100%;
  min-width: 0;
  background: #F8F6F2;
  border-radius: 8px;
  padding: 6px 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.76rem;
  line-height: 1.4;
  text-align: left;
}

.chat-item-user-line,
.chat-item-ai-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.chat-item-user-line {
  color: #362529;
  font-weight: 700;
}

.chat-item-ai-line {
  color: #6B5B5F;
}

.role-chip {
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1.3;
}

.role-chip.you {
  background: #EDE6DA;
  color: #4A373C;
}

.role-chip.ai {
  background: #E4ECE9;
  color: #1F514C;
}

.line-body {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 右側（スマホでは全画面切替）：LINE風チャット履歴＆送信パネル */
.chat-detail-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: #FFFFFF;
  border: 2px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-warm);
}

.btn-back-chat-list {
  display: none;
  background: var(--bordeaux-soft);
  color: var(--bordeaux);
  border: 1.5px solid var(--bordeaux);
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.chat-detail-title-wrap {
  flex: 1;
  min-width: 0;
}

.chat-detail-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-chat-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
  line-height: 1.35;
}

.chat-messages-box {
  background: #F4EFE6;
  border: 1px solid var(--border-warm);
  border-radius: 12px;
  padding: 12px;
  height: 390px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.chat-empty-guide {
  margin: auto;
  text-align: center;
  color: var(--text-sub);
  font-size: 0.88rem;
  padding: 20px;
}

.chat-bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}

.chat-bubble-row.user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-bubble-row.ai {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-bubble-meta {
  font-size: 0.71rem;
  color: var(--text-sub);
  margin-bottom: 3px;
  font-weight: 700;
}

.chat-bubble {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.chat-bubble-row.user .chat-bubble {
  background: var(--bordeaux);
  color: #FFFFFF;
  border-bottom-right-radius: 3px;
}

.chat-bubble-row.ai .chat-bubble {
  background: #FFFFFF;
  color: var(--text-main);
  border: 1px solid var(--border-warm);
  border-bottom-left-radius: 3px;
}

.chat-bubble-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chat-bubble-img {
  max-width: 190px;
  max-height: 220px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  object-fit: cover;
  cursor: zoom-in;
  background: #FFFFFF;
}

/* ワンタップ定型文バー */
.quick-reply-bar {
  display: flex;
  align-items: center;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 2px;
}

.quick-reply-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-sub);
  white-space: nowrap;
}

.quick-reply-chip {
  background: var(--bg-cream);
  color: var(--bordeaux);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.quick-reply-chip:hover {
  background: var(--gold-light);
}

/* 遠隔送信フォーム＆スクショ添付 */
.remote-send-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.remote-image-preview-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #FAF6EE;
  border: 1px dashed var(--gold);
  border-radius: 10px;
  padding: 8px 10px;
}

.preview-thumb-item {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--bordeaux);
  background: #FFFFFF;
}

.preview-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(123, 30, 45, 0.9);
  color: #FFFFFF;
  font-size: 0.72rem;
  padding: 0;
  line-height: 1;
}

.remote-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.btn-attach-image {
  background: #FAF5FF;
  color: var(--bordeaux);
  border: 1.5px dashed var(--bordeaux);
  border-radius: 10px;
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 1.1rem;
  min-width: 68px;
}

.btn-attach-image span {
  font-size: 0.68rem;
  font-weight: 800;
}

.btn-attach-image:hover {
  background: var(--bordeaux-soft);
}

.remote-msg-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-warm);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}

.remote-msg-input:focus {
  outline: none;
  border-color: var(--bordeaux);
}

.remote-send-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.remote-send-buttons .btn-gold-cta {
  flex: 1;
}

/* 📱 スマホ縦型画面（ポートレート）専用最適化 */
@media (max-width: 900px) {
  .hero-header {
    padding: 12px 12px 13px;
  }

  .hero-top-row {
    margin-bottom: 6px;
  }

  .brand-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    letter-spacing: 0.05em;
  }

  .last-updated {
    font-size: 0.68rem;
  }

  .btn-header-pill {
    padding: 3px 9px;
    font-size: 0.7rem;
  }

  .hero-title {
    font-size: 1.12rem;
    margin-bottom: 8px;
  }

  .hero-story {
    display: none;
  }

  .section-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 2px;
    gap: 4px;
    padding-bottom: 0;
  }

  .quick-reply-bar::-webkit-scrollbar {
    display: none;
  }

  .quick-reply-bar {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .nav-pill {
    white-space: nowrap;
    justify-content: center;
    padding: 5px 2px;
    font-size: 0.68rem;
    gap: 2px;
    min-width: 0;
  }

  .main-container {
    margin-top: 10px;
    padding: 0 8px;
    gap: 14px;
  }

  .section-block {
    padding: 13px 10px;
  }

  .remote-top-bar {
    flex-wrap: nowrap;
    padding-bottom: 8px;
    margin-bottom: 10px;
  }

  .auto-poll-toggle {
    padding: 4px 8px;
    font-size: 0.71rem;
  }

  .btn-refresh-mini {
    padding: 4px 9px;
    font-size: 0.75rem;
  }

  .remote-chats-section .section-lead {
    display: none;
  }

  .section-title {
    font-size: 0.98rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    white-space: nowrap;
  }

  .section-lead {
    font-size: 0.8rem;
    margin-bottom: 10px;
  }

  .chat-item-badges {
    gap: 4px;
  }

  .chat-engine-tag,
  .chat-topic-tag {
    padding: 2px 6px;
    font-size: 0.69rem;
  }

  .chat-rel-time {
    font-size: 0.7rem;
    padding: 1px 6px;
  }

  .chat-engine-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    margin-bottom: 10px;
  }

  .engine-tab-btn {
    padding: 6px 2px;
    font-size: 0.71rem;
    flex-direction: column;
    gap: 2px;
    border-radius: 8px;
  }

  .engine-tab-label {
    gap: 3px;
    letter-spacing: -0.03em;
  }

  .engine-dot {
    width: 6px;
    height: 6px;
  }

  .engine-tab-count {
    font-size: 0.65rem;
    padding: 0 6px;
  }

  .remote-chats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-list-panel {
    padding: 10px 8px;
  }

  .chat-detail-panel {
    padding: 12px 10px;
  }

  .chat-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* スマホ縦型：一覧モードのときは詳細トーク画面を隠してスッキリ縦並びにする */
  .remote-chats-grid:not(.mobile-chat-open) .chat-detail-panel {
    display: none;
  }

  /* スマホ縦型：チャットをタップしたらトーク画面に全集中（一覧を隠して「⬅ 一覧に戻る」を表示） */
  .remote-chats-grid.mobile-chat-open .chat-list-panel {
    display: none;
  }

  .remote-chats-grid.mobile-chat-open .btn-back-chat-list {
    display: inline-flex;
  }

  .active-chats-list {
    max-height: none;
  }

  .chat-messages-box {
    height: 50vh;
    min-height: 280px;
  }
}

/* PART 05: 守りの状態 ＆ スマホ通知 */
.ntfy-steps {
  margin: 0 0 10px;
  padding-left: 1.3em;
  font-size: 0.9rem;
  line-height: 1.7;
}
.ntfy-steps code {
  background: rgba(123, 30, 45, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}
.ntfy-url-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.ntfy-url-row input {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 0.85rem;
}

/* ⚡ フル実行承認ボタン（赤系＆送信ボタンから離して誤タップ防止） */
.remote-send-buttons {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.btn-full-exec {
  margin-top: 12px;
  background: #FFF1F2 !important;
  color: #9F1239 !important;
  border: 1.5px solid #FDA4AF !important;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 9px 14px;
  border-radius: 10px;
  width: 100%;
}

.btn-full-exec:hover:not(:disabled) {
  background: #FFE4E6 !important;
  border-color: #F43F5E !important;
}

/* 自宅PCが寝ているときのお知らせ（Cloudflare Pages 版） */
.pc-down-banner {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--amber-bg);
  border: 1px solid #F5D08A;
  color: #5B3A00;
}
.pc-down-banner[hidden] {
  display: none;
}
.pc-down-title {
  margin: 0 0 4px;
  font-weight: 800;
  font-size: 1rem;
}
.pc-down-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
}
