  :root {
    --bg-color: #FDFBF9;
    --primary-color: #C87556;
    --text-color: #4D3A30;
    --accent: var(--primary-color);
    --accent2: rgba(200, 117, 86, 0.9);
    --accent-light: rgba(200, 117, 86, 0.12);
    --bg: var(--bg-color);
    --bg2: #ffffff;
    --surface: #ffffff;
    --border: rgba(77, 58, 48, 0.22);
    --border2: rgba(77, 58, 48, 0.15);
    --density-color: #fca311;
    --text: var(--text-color);
    --text2: rgba(77, 58, 48, 0.92);
    --text3: rgba(77, 58, 48, 0.80);
    --gold: #C29525;
    --gold-light: #fdf3dc;
    --green: #5a8a6a;
    --green-light: #eaf3ec;
    --blue: #4a6e9a;
    --blue-light: #e8f0f8;
    --purple: #8a5a9a;
    --purple-light: #f3eaf8;
    --shadow: 0 2px 12px rgba(77, 58, 48, 0.06);
    --shadow2: 0 4px 20px rgba(77, 58, 48, 0.10);
    --shadow3: 0 1px 4px rgba(77, 58, 48, 0.04);
    --radius: 14px;
    --radius2: 8px;
    --transition-fast: 0.15s ease;
    --transition-med: 0.25s ease;
  }

  /* ダークモード */
  [data-theme="dark"] {
    --bg-color: #1a1614;
    --primary-color: #d4907a;
    --text-color: #e0d6cf;
    --accent: var(--primary-color);
    --accent2: rgba(212, 144, 122, 0.9);
    --accent-light: rgba(212, 144, 122, 0.15);
    --bg: var(--bg-color);
    --bg2: #241f1c;
    --surface: #2a2420;
    --border: rgba(224, 214, 207, 0.25);
    --border2: rgba(224, 214, 207, 0.18);
    --density-color: #fca311;
    --text: var(--text-color);
    --text2: rgba(224, 214, 207, 0.88);
    --text3: rgba(224, 214, 207, 0.80);
    --gold: #d4a94e;
    --gold-light: #2e2818;
    --green: #7aab8a;
    --green-light: #1c2a20;
    --blue: #7a9ec4;
    --blue-light: #1a2430;
    --purple: #a87ab8;
    --purple-light: #2a1c30;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.20);
    --shadow2: 0 4px 20px rgba(0, 0, 0, 0.30);
    --shadow3: 0 1px 4px rgba(0, 0, 0, 0.15);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  textarea, input, select, button {
    font-family: inherit;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
  }

  /* ===== 入力欄の未入力文字（プレースホルダー）の視認性向上 ===== */
  ::placeholder {
    color: rgba(77, 58, 48, 0.65) !important;
    opacity: 1 !important;
  }
  [data-theme="dark"] ::placeholder {
    color: rgba(224, 214, 207, 0.65) !important;
  }

  body {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    position: relative;
    background: var(--bg-color);
    color: var(--text);
    min-height: 100vh;
    background-image:
      radial-gradient(circle at 18% 18%, var(--accent-light) 0%, transparent 60%),
      radial-gradient(circle at 82% 86%, var(--accent-light) 0%, transparent 60%);
  }

  /* ヘッダー */
  .header {
    text-align: center;
    padding: 36px 20px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .header-badge {
    display: inline-block;
    background: var(--accent-light);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--accent);
    margin: 0;
  }
  .header h1 {
    font-family: 'Shippori Mincho', serif;
    font-size: clamp(22px, 5vw, 30px);
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.05em;
    margin: 0;
  }
  .header h1 span {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.02em;
  }
  .header p {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text2);
    font-weight: 500;
  }
  .header-how-to {
    margin-top: 8px;
    background: var(--blue-light);
    border: 1px solid rgba(74,110,154,0.2);
    border-radius: 10px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 600px;
  }
  .how-to-pc, .how-to-mobile {
    font-size: 12px;
    color: var(--text2);
    line-height: 1.5;
    flex: 1;
  }
  .how-to-pc strong, .how-to-mobile strong { color: var(--accent); }
  .how-to-mobile { display: none; }
  @media (max-width: 767px) {
    .how-to-pc { display: none !important; }
    .how-to-mobile { display: inline !important; }
  }
  .how-to-close {
    background: none; border: none; color: var(--text3); cursor: pointer;
    font-size: 16px; padding: 2px 4px; line-height: 1; flex-shrink: 0;
  }

  /* メインレイアウト */
  .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 16px 60px;
  }

  /* モード切替タブ */
  .mode-tabs {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    gap: 4px;
  }
  .mode-tab {
    flex: 1;
    padding: 10px 12px;
    border-radius: calc(var(--radius) - 4px);
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  .mode-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(201,113,74,0.30);
    font-weight: 700;
  }
  .mode-tab:not(.active):hover {
    background: var(--accent-light);
    color: var(--accent);
  }
  .mode-tab:active { transform: scale(0.97); }

  /* カード */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow var(--transition-med), transform var(--transition-med);
  }
  .card:hover { box-shadow: var(--shadow2); }
  .card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg2);
  }
  .card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* シーン選択 */
  .scene-row {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .scene-row::-webkit-scrollbar { display: none; }
  .scene-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text3);
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .scene-btn {
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border2);
    background: var(--bg);
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 11px;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .scene-btn.active {
    background: var(--gold-light);
    border-color: var(--gold);
    color: var(--gold);
    font-weight: 700;
  }
  .scene-btn:not(.active):hover {
    background: var(--bg2);
  }

  /* テキストエリア */
  .editor-wrap {
    position: relative;
    padding: 16px 18px;
  }

  /* ---- 執筆モード ---- */
  #write-area {
    width: 100%;
    min-height: 200px;
    border: none;
    outline: none;
    resize: none;
    overflow-y: hidden;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: transparent;
  }

  /* ---- ブラッシュアップモード ---- */
  #brush-input {
    width: 100%;
    min-height: 160px;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: transparent;
  }

  /* ハイライト表示エリア */
  .highlight-area {
    font-size: 15px;
    line-height: 1.7;
    min-height: 80px;
    padding: 12px 0 4px;
    word-break: break-all;
  }
  .highlight-area .word-hit {
    background: linear-gradient(0deg, rgba(201,113,74,0.22) 0%, rgba(201,113,74,0.06) 100%);
    border-bottom: 2px solid var(--accent);
    border-radius: 3px;
    cursor: pointer;
    padding: 1px 3px;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
  }
  .highlight-area .word-hit:hover {
    background: rgba(201,113,74,0.28);
    box-shadow: 0 2px 6px rgba(201,113,74,0.15);
  }

  /* フッターバー */
  .editor-footer {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg2);
    flex-wrap: wrap;
    gap: 8px;
  }
  .char-count {
    font-size: 12px;
    color: var(--text3);
  }
  .char-count span { color: var(--text2); font-weight: 700; }
  .editor-btns { display: flex; gap: 6px; }
  .editor-btn-labeled { display: inline-flex; align-items: center; gap: 4px; }
  .eb-icon { font-size: 14px; line-height: 1; }
  .eb-label { font-size: 11px; }

  /* ボタン共通 */
  .btn {
    padding: 8px 16px;
    border-radius: var(--radius2);
    border: none;
    cursor: pointer;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 700;
    transition: all 0.15s;
  }
  .btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(201,113,74,0.3);
  }
  .btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
  .btn-primary:active { transform: translateY(0); }
  .btn-secondary {
    background: var(--bg);
    color: var(--text2);
    border: 1px solid var(--border2);
  }
  .btn-secondary:hover { background: var(--bg2); }
  .btn-ghost {
    background: transparent;
    color: var(--text3);
    border: 1px solid var(--border);
    padding: 6px 12px;
    font-size: 12px;
  }
  .btn-ghost:hover { color: var(--text2); border-color: var(--border2); }

  /* 類語ポップオーバー */
  .synonym-popover {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    box-shadow: var(--shadow2);
    padding: 14px 16px;
    z-index: 1000;
    width: 280px;
    max-height: 70vh;
    overflow-y: auto;
    display: none;
    animation: popIn 0.15s ease;
  }
  @keyframes popIn {
    from { opacity: 0; transform: scale(0.96) translateY(-6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }
  .synonym-popover.show { display: block; }
  .syn-word {
    font-size: 11px;
    color: var(--text3);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .syn-word strong { color: var(--accent); font-size: 14px; }
  .syn-group { margin-bottom: 10px; }
  .syn-group-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text3);
    margin-bottom: 5px;
  }
  .syn-chips { display: flex; flex-wrap: wrap; gap: 5px; }
  .syn-chip {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.12s;
    font-family: 'Zen Maru Gothic', sans-serif;
  }
  .syn-chip.soft { background: var(--green-light); border-color: var(--green); color: var(--green); }
  .syn-chip.strong { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
  .syn-chip.poetic { background: var(--purple-light); border-color: var(--purple); color: var(--purple); }
  .syn-chip:hover { filter: brightness(0.95); transform: translateY(-1px); }
  .syn-close {
    position: absolute;
    top: 8px; right: 10px;
    background: var(--bg2); border: 1px solid var(--border);
    color: var(--text2); cursor: pointer;
    font-size: 18px; line-height: 1;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
  }

  /* AI改善パネル */
  .ai-panel {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .ai-panel-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--gold-light), var(--accent-light));
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text2);
  }
  .ai-panel-body {
    padding: 16px;
    background: var(--surface);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    min-height: 60px;
  }
  .ai-panel-body.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text3);
  }
  .dots span {
    display: inline-block;
    animation: dot 1.2s infinite;
    font-size: 20px;
    line-height: 1;
  }
  .dots span:nth-child(2) { animation-delay: 0.2s; }
  .dots span:nth-child(3) { animation-delay: 0.4s; }
  @keyframes dot {
    0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-4px); }
  }
  .ai-actions {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg2);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
  }

  /* リアルタイム検出バナー */
  .rt-hint {
    font-size: 11px;
    color: var(--text3);
    padding: 6px 18px 2px;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .rt-badge {
    display: inline-block;
    background: var(--green-light);
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    border: 1px solid var(--green);
  }

  /* 検出ワードリスト（執筆モード） */
  .detected-bar {
    padding: 8px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg2);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 42px;
  }
  .detected-label {
    font-size: 11px;
    color: var(--text3);
    white-space: nowrap;
  }
  .detected-chip {
    padding: 3px 10px;
    background: var(--accent-light);
    border: 1px solid rgba(201,113,74,0.4);
    border-radius: 20px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s;
  }
  .detected-chip:hover {
    background: var(--accent);
    color: white;
  }
  .no-detect { font-size: 12px; color: var(--text3); font-style: italic; }

  /* コピー成功トースト */
  .toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    transition: all 0.25s;
    pointer-events: none;
    z-index: 2000;
  }
  .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  /* セパレーター */
  .sep { height: 1px; background: var(--border); margin: 20px 0; }

  /* 感情カテゴリタブ */
  .emotion-category-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
  /* 感情軸アコーディオン */
  .emo-axis-section { border-bottom: 1px solid var(--border); }
  .emo-axis-section:last-child { border-bottom: none; }
  .emo-axis-head {
    width: 100%; background: none; border: none; text-align: left;
    padding: 9px 14px; cursor: pointer; display: flex; align-items: center;
    justify-content: space-between; gap: 8px;
    font-family: 'Zen Maru Gothic', sans-serif; transition: background 0.15s;
  }
  .emo-axis-head:hover { background: var(--bg2); }
  .emo-axis-name {
    font-size: 12px; font-weight: 700; color: var(--text2);
    display: flex; align-items: center; gap: 6px;
  }
  .emo-axis-icon { font-size: 15px; }
  .emo-axis-arrow { font-size: 11px; color: var(--text3); transition: transform 0.2s; }
  .emo-axis-section.open .emo-axis-arrow { transform: rotate(180deg); }
  .emo-axis-body { display: none; padding: 8px 14px 12px; }
  .emo-axis-section.open .emo-axis-body { display: block; }
  .emo-word-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
  .emo-word-btn {
    padding: 5px 14px; border-radius: 20px;
    border: 1.5px solid var(--border2); background: var(--bg);
    font-family: 'Zen Maru Gothic', sans-serif; font-size: 13px; color: var(--text);
    cursor: pointer; transition: all 0.15s;
  }
  .emo-word-btn:hover, .emo-word-btn.selected {
    background: var(--accent-light); border-color: var(--accent); color: var(--accent);
  }
  .emo-alts {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 8px 10px; background: var(--bg2); border-radius: 8px;
    border: 1px solid var(--border);
  }
  .emo-alt-chip {
    padding: 5px 12px; border-radius: 20px;
    border: 1px solid var(--accent2); background: var(--accent-light);
    font-family: 'Zen Maru Gothic', sans-serif; font-size: 12px; color: var(--accent);
    cursor: pointer; transition: all 0.15s;
  }
  .emo-alt-chip:hover { background: var(--accent); color: white; border-color: var(--accent); }
  .emo-alt-chip:active { transform: scale(0.95); }
  .emo-alt-chip.flash { background: var(--green); border-color: var(--green); color: white; }

  .emotion-cat-btn {
    padding: 5px 14px; border-radius: 20px; border: 1px solid var(--border2);
    background: var(--bg); font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 12px; font-weight: 700; color: var(--text2); cursor: pointer; transition: all 0.15s;
  }
  .emotion-cat-btn.active { color: white; border-color: transparent; }
  .emotion-cat-btn.cat-pos.active  { background: var(--green); }
  .emotion-cat-btn.cat-exc.active  { background: var(--purple); }
  .emotion-cat-btn.cat-sad.active  { background: var(--blue); }
  .emotion-cat-btn.cat-mix.active  { background: var(--accent); }

  /* 感情グリッド */
  .emotion-grid { display: flex; flex-wrap: wrap; gap: 8px; }
  .emotion-btn {
    padding: 7px 14px; border-radius: 20px; border: 1px solid;
    font-family: 'Zen Maru Gothic', sans-serif; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; background: white;
  }
  .emotion-btn.cat-pos { border-color: var(--green); color: var(--green); }
  .emotion-btn.cat-pos:hover { background: var(--green-light); }
  .emotion-btn.cat-exc { border-color: var(--purple); color: var(--purple); }
  .emotion-btn.cat-exc:hover { background: var(--purple-light); }
  .emotion-btn.cat-sad { border-color: var(--blue); color: var(--blue); }
  .emotion-btn.cat-sad:hover { background: var(--blue-light); }
  .emotion-btn.cat-mix { border-color: var(--accent); color: var(--accent); }
  .emotion-btn.cat-mix:hover { background: var(--accent-light); }

  /* 感情逆引き結果 */
  .expr-group { margin-bottom: 14px; }
  .expr-group-label { font-size: 11px; font-weight: 700; color: var(--text3); letter-spacing: 0.06em; margin-bottom: 7px; }
  .expr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .expr-chip {
    padding: 6px 14px; border-radius: 20px; font-size: 13px;
    cursor: pointer; border: 1px solid; transition: all 0.12s;
    font-family: 'Zen Maru Gothic', sans-serif;
  }
  .expr-chip.soft   { background: var(--green-light);  border-color: var(--green);  color: var(--green); }
  .expr-chip.medium { background: var(--gold-light);   border-color: var(--gold);   color: var(--gold); }
  .expr-chip.strong { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
  .expr-chip.poetic { background: var(--purple-light); border-color: var(--purple); color: var(--purple); }
  .expr-chip:hover { filter: brightness(0.94); transform: translateY(-2px); box-shadow: var(--shadow); }
  .expr-chip:active { transform: scale(0.96); }

  /* アシストステップ */
  .assist-step { padding: 18px 18px 6px; }
  .assist-q { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; line-height: 1.6; }
  .assist-q-sub { font-size: 12px; color: var(--text3); font-weight: 400; margin-top: 3px; }
  .assist-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
  .assist-opt {
    padding: 8px 16px; border-radius: var(--radius2); border: 1px solid var(--border2);
    background: var(--bg); font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 13px; color: var(--text2); cursor: pointer; transition: all 0.15s;
  }
  .assist-opt.selected { background: var(--accent); color: white; border-color: var(--accent); font-weight: 700; }
  .assist-opt:not(.selected):hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
  .assist-textarea {
    width: 100%; min-height: 80px; border: 1px solid var(--border2); border-radius: var(--radius2);
    padding: 10px 14px; font-family: 'Zen Maru Gothic', sans-serif; font-size: 14px;
    line-height: 1.7; color: var(--text); background: var(--bg); resize: none; outline: none;
    margin-bottom: 8px;
  }
  .assist-textarea:focus { border-color: var(--accent); background: white; }
  .assist-dots { display: flex; gap: 6px; padding: 8px 18px; }
  .assist-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border2); transition: background 0.2s; }
  .assist-dot.done { background: var(--accent); }
  .assist-dot.current { background: var(--accent2); }

  /* レスポンシブ */
  @media (max-width: 600px) {
    .header { padding: 24px 16px 16px; gap: 8px; }
    .header-badge { font-size: 10px; padding: 3px 10px; }
    .header h1 { font-size: 18px; }
    .header p { font-size: 12px; }

    .container { padding: 0 12px 40px; }
    
    /* 入力欄：16px以上にするとiOSでフォーカス時にズームされない */
    #write-area, #brush-input { font-size: 16px; min-height: 180px; }
    
    .mode-tabs { gap: 2px; padding: 4px; }
    .mode-tab { font-size: 11px; padding: 10px 4px; }
    
    /* ボタンのタッチターゲット拡大 */
    .btn { padding: 10px 16px; min-height: 42px; font-size: 14px; }
    .btn-ghost { padding: 8px 12px; }
    .editor-btns { width: 100%; justify-content: flex-start; gap: 4px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .editor-btns::-webkit-scrollbar { display: none; }
    .editor-btns .btn { justify-content: center; padding: 7px 8px; flex-shrink: 0; }
    .editor-btn-labeled { flex: 0 0 auto !important; }
    .eb-label { font-size: 10px; }
    
    /* チップ類の押しやすさ向上 */
    .detected-chip, .syn-chip, .fav-chip, .snippet-chip, .expr-chip, .emotion-btn, .emotion-cat-btn {
      padding: 8px 14px;
      margin: 2px 0;
      font-size: 13px !important; /* 少し大きく */
    }
    
    /* モーダルリストの改善 */
    .draft-row { padding: 14px 16px; }
    .draft-title { font-size: 14px; }
    
    .synonym-popover { width: calc(100% - 24px); left: 12px !important; }
  }

  /* インライン検索エリア */
  .inline-search-wrap {
    margin-bottom: 16px;
    position: relative;
    z-index: 50;
  }
  .inline-search-box {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 14px;
    box-shadow: var(--shadow3);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  }
  .inline-search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(200, 117, 86, 0.15);
  }
  .inline-search-icon {
    width: 18px;
    height: 18px;
    color: var(--text3);
    flex-shrink: 0;
    margin-right: 8px;
  }
  .syn-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 14px !important;
    color: var(--text);
    outline: none;
    padding: 0;
    width: 100%;
  }
  .syn-search-clear {
    background: none;
    border: none;
    color: var(--text3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    margin-left: 4px;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
  }
  .syn-search-clear:hover { background: var(--bg2); color: var(--accent); }
  .syn-search-clear i { width: 16px; height: 16px; }
  .inline-search-result {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 12px 16px;
    max-height: 400px;
    overflow-y: auto;
  }

  /* ─── 推しポイント備忘録（ピン留め） ─── */
  .pin-section {
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    padding: 8px 14px 10px;
  }
  .pin-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 7px;
  }
  .pin-section-title {
    font-size: 11px; font-weight: 700; color: var(--text2);
    display: flex; align-items: center; gap: 5px;
  }
  .pin-toggle-btn {
    font-size: 11px; color: var(--text3); background: none; border: none;
    cursor: pointer; padding: 2px 6px; border-radius: 4px; line-height: 1.4;
    transition: background 0.15s;
  }
  .pin-toggle-btn:hover { background: var(--border); }
  .pin-input-row {
    display: flex; gap: 5px; align-items: center; margin-bottom: 7px;
  }
  .pin-tc-input {
    width: 80px; flex-shrink: 0; padding: 6px 8px;
    border: 1px solid var(--border2); border-radius: 7px;
    font-family: 'Zen Maru Gothic', sans-serif; font-size: 12px;
    color: var(--text); background: var(--bg); outline: none;
  }
  .pin-tc-input:focus { border-color: var(--accent); }
  .pin-content-input {
    flex: 1; min-width: 0; padding: 6px 8px;
    border: 1px solid var(--border2); border-radius: 7px;
    font-family: 'Zen Maru Gothic', sans-serif; font-size: 12px;
    color: var(--text); background: var(--bg); outline: none;
  }
  .pin-content-input:focus { border-color: var(--accent); }
  .pin-add-btn {
    flex-shrink: 0; padding: 6px 10px; border-radius: 7px;
    border: none; background: var(--accent); color: white;
    font-family: 'Zen Maru Gothic', sans-serif; font-size: 12px;
    cursor: pointer; white-space: nowrap; font-weight: 700;
    transition: opacity 0.15s;
  }
  .pin-add-btn:hover { opacity: 0.85; }
  .pin-list {
    list-style: none; padding: 0; margin: 0;
    max-height: 150px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 4px;
    scrollbar-width: thin; scrollbar-color: var(--border2) transparent;
  }
  .pin-list:empty::after {
    content: 'まだありません。上の入力欄から追加してください';
    display: block; font-size: 11px; color: var(--text3);
    text-align: center; padding: 8px 0;
  }
  .pin-list-item {
    display: flex; align-items: center; gap: 5px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 7px; padding: 5px 8px;
    font-size: 12px; color: var(--text2); line-height: 1.4;
    animation: pin-slide-in 0.18s ease;
  }
  @keyframes pin-slide-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .pin-item-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pin-item-tc { font-size: 11px; font-weight: 700; color: var(--accent); margin-right: 3px; flex-shrink: 0; }
  .pin-insert-btn {
    flex-shrink: 0; padding: 3px 8px; border-radius: 5px;
    border: 1px solid var(--accent2); background: var(--accent-light);
    color: var(--accent); font-size: 11px; font-family: 'Zen Maru Gothic', sans-serif;
    cursor: pointer; white-space: nowrap; transition: background 0.15s;
  }
  .pin-insert-btn:hover { background: var(--accent2); color: white; border-color: var(--accent2); }
  .pin-insert-btn.done { background: var(--green); border-color: var(--green); color: white; }
  .pin-del-btn {
    flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
    border: none; background: transparent; color: var(--text3);
    font-size: 14px; cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: background 0.15s, color 0.15s;
    line-height: 1; padding: 0;
  }
  .pin-del-btn:hover { background: #fee; color: #c00; }

  /* お気に入りパネル */
  .fav-panel {
    padding: 10px 18px; border-bottom: 1px solid var(--border);
    background: var(--gold-light);
  }
  .fav-panel-title { font-size: 11px; font-weight: 700; color: var(--gold); margin-bottom: 7px; }
  .fav-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .fav-chip {
    padding: 4px 10px; border-radius: 20px; font-size: 12px;
    background: white; border: 1px solid var(--gold);
    color: var(--gold); cursor: pointer; display: flex; align-items: center; gap: 5px;
    font-family: 'Zen Maru Gothic', sans-serif;
  }
  .fav-chip:hover { background: var(--gold-light); }
  .fav-del { color: var(--text3); font-size: 14px; line-height: 1; }
  .fav-empty { font-size: 12px; color: var(--text3); font-style: italic; }

  /* SNS文字数インジケーター */
  .sns-indicator {
    display: flex; gap: 10px; align-items: center;
    padding: 4px 0;
  }
  .sns-badge {
    font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 10px; border: 1px solid;
  }
  .sns-badge.ok   { background: var(--green-light); border-color: var(--green); color: var(--green); }
  .sns-badge.warn { background: var(--gold-light); border-color: var(--gold); color: var(--gold); }
  .sns-badge.over { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }

  /* 濃い感想ヒント */
  .hint-panel {
    background: var(--blue-light); border: 1px solid rgba(74,110,154,0.2);
    border-radius: 10px; padding: 12px 16px; margin-top: 12px;
    font-size: 12px; color: var(--text2); line-height: 1.8;
  }
  .hint-panel strong { color: var(--blue); }

  /* ===== 新機能CSS ===== */
  .mode-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .mode-tab { white-space: nowrap; }

  /* 感情語密度メーター */
  .density-bar-wrap { padding: 10px 18px; border-top: 1px solid var(--border); background: var(--bg2); display: none; }
  .density-label { font-size: 11px; color: var(--text3); margin-bottom: 5px; display: flex; justify-content: space-between; }
  .density-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
  .density-fill { height: 100%; border-radius: 4px; background-color: var(--density-color); transition: width 0.3s ease, background-color 0.3s ease; }
  .density-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
  .density-tag { font-size: 10px; padding: 1px 8px; border-radius: 10px; background: var(--accent-light); color: var(--accent); border: 1px solid rgba(201,113,74,0.3); }

  /* 下書き保存 */
  /* 下書きモーダル専用 */
  .data-alert-p { padding: 10px 18px; font-size: 11px; color: var(--text3); line-height: 1.6; border-bottom: 1px solid var(--border); }
  .draft-save-area { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px; margin-bottom: 0; border-bottom: 1px solid var(--border); }
  .draft-save-area input[type="text"] { width: 100%; padding: 10px 14px; border: 1px solid var(--border2); border-radius: 8px; font-family: 'Zen Maru Gothic', sans-serif; font-size: 13px; color: var(--text); background: var(--bg); outline: none; box-sizing: border-box; }
  .draft-save-area input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(139,116,88,0.15); }
  .draft-save-area .btn-save { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; font-size: 14px; font-weight: 600; }
  .draft-list-container { padding: 0 18px 12px; }
  .draft-list-container h3 { font-size: 15px; margin: 14px 0 12px; color: var(--text2); }
  .draft-list { display: flex; flex-direction: column; gap: 0; max-height: 300px; overflow-y: auto; list-style: none; padding: 0; margin: 0; }
  .draft-row { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.12s; }
  .draft-row:hover { background: var(--bg2); }
  .draft-row:last-child { border-bottom: none; }
  .draft-info { flex: 1; min-width: 0; }
  .draft-title { font-size: 13px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .draft-meta { font-size: 11px; color: var(--text3); white-space: nowrap; margin-top: 2px; }
  .draft-del { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 16px; padding: 4px 6px; flex-shrink: 0; }
  .draft-del:hover { color: var(--accent); }
  .draft-empty { padding: 24px 0; text-align: center; color: var(--text3); font-size: 13px; }

  /* テンプレパネル */
  .template-grid { display: flex; flex-direction: column; gap: 6px; padding: 10px 18px 14px; max-height: 180px; overflow-y: auto; flex-wrap: nowrap; }
  .tmpl-btn-wrap { display: flex; flex-direction: row; align-items: center; justify-content: space-between; width: 100%; gap: 8px; }
  .tmpl-btn { flex: 1; text-align: left; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border2); background: var(--bg); font-family: 'Zen Maru Gothic', sans-serif; font-size: 13px; font-weight: 700; color: var(--text2); cursor: pointer; transition: all 0.15s; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tmpl-btn:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
  .tmpl-btn .tmpl-sub { font-size: 10px; font-weight: 400; color: var(--text3); display: none; }
  .tmpl-btn.tmpl-custom { border-color: var(--purple); background: var(--purple-light); }
  .tmpl-btn.tmpl-custom:hover { background: var(--purple); color: white; }
  .tmpl-custom-badge { font-size: 10px; background: var(--purple); color: white; padding: 2px 6px; border-radius: 8px; margin-right: 6px; }
  .tmpl-actions { display: flex; gap: 4px; margin-top: 0; flex-shrink: 0; }
  .tmpl-act-btn { background: var(--bg2); border: 1px solid transparent; font-size: 11px; color: var(--text3); cursor: pointer; padding: 6px 10px; border-radius: 6px; transition: all 0.15s; font-family: 'Zen Maru Gothic', sans-serif; }
  .tmpl-act-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--border); }
  .tmpl-act-btn.tmpl-act-del:hover { background: #fde8e8; color: #c00; border-color: #fca; }
  .tmpl-edit-form { padding: 12px 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--bg); margin: 4px 0; }
  .tmpl-edit-form input, .tmpl-edit-form textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border2); border-radius: 8px; font-family: 'Zen Maru Gothic', sans-serif; font-size: 13px; color: var(--text); background: var(--surface); outline: none; box-sizing: border-box; }
  .tmpl-edit-form textarea { min-height: 80px; resize: vertical; line-height: 1.6; margin-top: 6px; }
  .tmpl-edit-form .tmpl-edit-btns { display: flex; gap: 8px; margin-top: 8px; }
  .tmpl-restore-bar { padding: 6px 18px; text-align: right; }
  .tmpl-restore-btn { background: none; border: 1px dashed var(--border); color: var(--text3); font-size: 11px; padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: all 0.15s; }
  .tmpl-restore-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

  /* 推しポイントモード */
  .oshi-point-wrap { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
  .oshi-point-row { display: flex; align-items: center; gap: 8px; }
  .oshi-point-num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: white; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .oshi-point-input { flex: 1; padding: 8px 12px; border: 1px solid var(--border2); border-radius: 8px; font-family: 'Zen Maru Gothic', sans-serif; font-size: 13px; color: var(--text); background: var(--bg); outline: none; }
  .oshi-point-input:focus { border-color: var(--accent); background: white; }
  .oshi-tc { width: 80px; padding: 8px 10px; border: 1px solid var(--border2); border-radius: 8px; font-family: 'Zen Maru Gothic', sans-serif; font-size: 12px; color: var(--text3); background: var(--bg); outline: none; }
  .oshi-tc:focus { border-color: var(--accent); background: white; }

  /* キーワード提案チップ */
  .kw-chip {
    padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 700;
    cursor: pointer; border: 2px solid; transition: all 0.15s;
    font-family: 'Zen Maru Gothic', sans-serif; user-select: none;
    opacity: 0.45;
  }
  .kw-chip.selected { opacity: 1; }
  .kw-main { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
  .kw-main.selected { background: var(--accent); color: white; }
  .kw-sub { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
  .kw-sub.selected { background: var(--blue); color: white; }

  /* スニペット */
  .snippet-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px; }
  .snippet-chip { padding: 5px 12px; border-radius: 20px; background: var(--blue-light); border: 1px solid rgba(74,110,154,0.3); color: var(--blue); font-size: 12px; cursor: pointer; font-family: 'Zen Maru Gothic', sans-serif; display: flex; align-items: center; gap: 5px; transition: all 0.12s; }
  .snippet-chip:hover { background: var(--blue); color: white; }
  .snippet-del-btn { opacity: 0.5; font-size: 14px; }

  /* スコア表示 */
  .score-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
  .score-label { width: 90px; font-size: 12px; color: var(--text2); flex-shrink: 0; }
  .score-track { flex: 1; height: 14px; background: var(--bg); border-radius: 4px; overflow: hidden; }
  .score-fill { height: 100%; border-radius: 4px; transition: width 0.8s ease; }
  .score-val { width: 36px; font-size: 12px; font-weight: 700; color: var(--text2); text-align: right; }

  /* モーダル共通 */
  .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1500; display: none; align-items: flex-end; justify-content: center; }
  .modal-overlay.show { display: flex; }
  .modal-sheet { background: var(--surface); border-radius: 18px 18px 0 0; width: 100%; max-width: 600px; max-height: 85vh; overflow-y: auto; padding-bottom: 24px; animation: slideUp 0.25s ease; }
  @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .modal-head { position: sticky; top: 0; background: var(--surface); padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; z-index: 1; }
  .modal-title { font-size: 14px; font-weight: 700; color: var(--text2); flex: 1; }
  .modal-close { background: none; border: none; font-size: 22px; color: var(--text3); cursor: pointer; }

  /* ===== 文章テクパネル ===== */
  /* 文章テクニックカード */
  .wt-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; background: var(--surface);
    transition: box-shadow var(--transition-med), transform var(--transition-med);
  }
  .wt-card:hover { box-shadow: var(--shadow2); transform: translateY(-1px); }
  .wt-card-head {
    padding: 10px 14px; background: linear-gradient(135deg, var(--bg2) 0%, var(--purple-light) 100%); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
  }
  .wt-cat-badge {
    font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
    background: var(--purple-light); color: var(--purple); letter-spacing: 0.04em; flex-shrink: 0;
    border: 1px solid rgba(138, 90, 154, 0.2);
  }
  .wt-title {
    font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.4;
  }
  .wt-body {
    padding: 12px 14px; font-size: 12.5px; color: var(--text2); line-height: 1.85;
    white-space: pre-line;
  }
  .wt-body strong { color: var(--accent); font-weight: 700; }

  .tip-cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
  .tip-cat {
    padding: 5px 14px; border-radius: 20px; border: 1px solid var(--border2);
    background: var(--bg); font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 12px; color: var(--text2); cursor: pointer; transition: all 0.15s;
  }
  .tip-cat.active { background: var(--purple-light); border-color: var(--purple); color: var(--purple); font-weight: 700; }
  .tip-cat:not(.active):hover { background: var(--bg2); }

  .tip-chip {
    display: inline-flex; align-items: center; padding: 6px 14px;
    border-radius: 20px; background: var(--bg2); border: 1px solid var(--border);
    font-size: 13px; color: var(--text); cursor: pointer; transition: all var(--transition-fast); margin: 3px;
    box-shadow: var(--shadow3);
  }
  .tip-chip:hover { background: var(--accent-light); border-color: var(--accent2); color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
  .tip-chip:active { transform: scale(0.96) translateY(0); }

  .conj-chip {
    display: inline-flex; flex-direction: column; align-items: center;
    padding: 8px 14px; border-radius: 12px; background: var(--blue-light);
    border: 1px solid var(--blue); cursor: pointer; transition: all var(--transition-fast); margin: 4px; text-align: center;
    box-shadow: var(--shadow3);
  }
  .conj-chip:hover { background: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow); }
  .conj-chip-text { font-size: 14px; font-weight: 700; color: var(--blue); }
  .conj-chip:hover .conj-chip-text { color: white; }
  .conj-chip-desc { font-size: 10px; color: var(--text3); margin-top: 2px; }
  .conj-chip:hover .conj-chip-desc { color: rgba(255,255,255,0.8); }

  .demo-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
    border-radius: 20px; background: var(--gold-light); border: 1px solid var(--gold);
    cursor: pointer; transition: all var(--transition-fast); margin: 4px;
    box-shadow: var(--shadow3);
  }
  .demo-chip:hover { background: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); }
  .demo-chip-text { font-size: 14px; font-weight: 700; color: var(--gold); }
  .demo-chip:hover .demo-chip-text { color: white; }
  .demo-chip-desc { font-size: 11px; color: var(--text3); }
  .demo-chip:hover .demo-chip-desc { color: rgba(255,255,255,0.8); }

  .check-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer;
    transition: background var(--transition-fast), padding var(--transition-fast), margin var(--transition-fast);
  }
  .check-item:last-child { border-bottom: none; }
  .check-item:hover { background: var(--bg2); margin: 0 -18px; padding-left: 18px; padding-right: 18px; border-radius: 6px; }
  .check-box {
    width: 22px; height: 22px; border: 2px solid var(--border2); border-radius: 6px;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    font-size: 13px; transition: all 0.2s; margin-top: 1px;
  }
  .check-item.done .check-box { background: var(--green); border-color: var(--green); color: white; }
  .check-item.done .check-text { color: var(--text3); text-decoration: line-through; }
  .check-text { font-size: 13px; color: var(--text); line-height: 1.6; flex: 1; }

  .alt-group-head {
    font-size: 11px; font-weight: 700; color: var(--text3);
    letter-spacing: 0.05em; margin: 10px 0 6px;
  }
  .tips-sub-label {
    font-size: 11px; font-weight: 700; color: var(--text3);
    letter-spacing: 0.05em; margin-bottom: 10px;
  }

  /* ===== ジャンルバー ===== */
  .genre-bar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(61,43,31,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .genre-bar-inner {
    max-width: 892px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .genre-bar-inner::-webkit-scrollbar { display: none; }
  .genre-btn {
    flex-shrink: 0;
    padding: 7px 18px;
    border-radius: 20px;
    border: 1.5px solid var(--border2);
    background: var(--bg);
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
  }
  .genre-btn.active,
  .mobile-genre-bar .genre-btn.active,
  .genre-bar-inner .genre-btn.active {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(201,113,74,0.3);
    font-weight: 700;
  }
  .genre-btn:not(.active):hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent2);
  }

  /* ===== 2カラムレイアウト ===== */
  .main-layout {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 24px;
    align-items: start;
  }
  .tool-column {
    position: sticky;
    top: 68px; /* genre-bar (≈58px) + 10px 余白 */
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border2) transparent;
  }
  .tool-column::-webkit-scrollbar { width: 4px; }
  .tool-column::-webkit-scrollbar-track { background: transparent; }
  .tool-column::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

  /* ツールモードタブ（右カラム内） */
  .tool-mode-tabs {
    display: flex;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 5px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    gap: 4px;
  }
  .tool-mode-tab {
    flex: 1 1 auto;
    white-space: nowrap;
    padding: 10px 16px;
    border-radius: calc(var(--radius) - 4px);
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
  }
  .tool-mode-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(201,113,74,0.30);
    font-weight: 700;
  }
  .tool-mode-tab:not(.active):hover {
    background: var(--accent-light);
    color: var(--accent);
  }
  .tool-mode-tab:active {
    transform: scale(0.96);
  }

  /* ジャンルプレースホルダー */
  .tool-placeholder {
    background: var(--surface);
    border: 2px dashed var(--border2);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    line-height: 1.8;
  }
  .tool-placeholder-icon { font-size: 36px; margin-bottom: 14px; }
  .tool-placeholder-genre {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 15px;
  }
  .tool-placeholder-text {
    font-size: 12px;
    color: var(--text3);
    margin-top: 14px;
    line-height: 1.7;
  }

  /* ===== モバイルレイアウト：全画面スプリット ===== */
  @media (max-width: 767px) {
    /* ヘッダーをコンパクト化してスペース確保 */
    .header {
      padding: 12px 16px 8px;
    }
    .header h1 { font-size: 18px; }
    .header p  { font-size: 11px; margin-top: 3px; }

    /* body をフレックスコラムにしてビューポートを完全に埋める */
    body {
      height: 100vh;
      height: 100svh; /* モバイルブラウザのアドレスバーを考慮 */
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
    .header    { flex-shrink: 0; }
    .genre-bar { flex-shrink: 0; }

    /* コンテナが残りのビューポートを占有 */
    .container {
      flex: 1;
      min-height: 0;
      overflow: hidden;
      padding: 0 10px;
      display: flex;
      flex-direction: column;
    }

    /* メインレイアウト：フレックスコラムで上下分割 */
    .main-layout {
      display: flex !important;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      gap: 0;
    }

    /* 執筆エリア（可変スプリット上部） — 第2メディアクエリで詳細設定 */
    .write-column {
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding-top: 4px;
      position: static;
    }
    .write-column #write-area { min-height: 90px; }

    /* 旧pseudo-elementハンドル廃止 → 実DOMハンドルへ移行 */
    .tool-column::before { display: none; }

    /* 支援ツールエリア（可変スプリット下部） — 第2メディアクエリで詳細設定 */
    .tool-column {
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      max-height: none;
      position: static;
      padding-bottom: 16px;
    }
    .tool-mode-tabs {
      overflow-x: auto;
      flex-wrap: nowrap;
      scrollbar-width: none;
    }
    .tool-mode-tabs::-webkit-scrollbar { display: none; }
    .tool-mode-tab { flex: 0 0 auto !important; white-space: nowrap !important; font-size: 11px; padding: 7px 8px; }
  }

  /* ===== 語彙カード（ジャンル別） ===== */
  .vocab-header {
    padding: 10px 2px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .vocab-header-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text2);
  }
  .vocab-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition-med), transform var(--transition-med);
  }
  .vocab-card:hover { box-shadow: var(--shadow2); transform: translateY(-1px); }
  .vocab-card-head {
    padding: 9px 14px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .vocab-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent);
    letter-spacing: 0.04em;
    flex-shrink: 0;
  }
  .vocab-original {
    font-size: 12px;
    color: var(--text3);
  }
  .vocab-alts {
    padding: 10px 12px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
  }
  .vocab-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border2);
    background: var(--bg);
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1.4;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    box-shadow: var(--shadow3);
  }
  .vocab-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent2);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
  }
  .vocab-btn:active { transform: scale(0.96) translateY(0); box-shadow: none; }
  .vocab-btn.flash {
    background: var(--green);
    border-color: var(--green);
    color: white;
    transform: scale(0.97);
  }
  .vocab-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text3);
    font-size: 14px;
    line-height: 1.9;
  }
  .vocab-empty-icon { font-size: 32px; margin-bottom: 10px; }

  /* お気に入りボタン */
  .vocab-alt-wrap { display: inline-flex; align-items: center; gap: 2px; }
  .vocab-fav-btn {
    width: 30px; height: 30px; border-radius: 50%;
    border: none; background: transparent;
    font-size: 15px; cursor: pointer; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text3); transition: color 0.15s, transform 0.15s, background 0.15s;
    flex-shrink: 0; padding: 0;
  }
  .vocab-fav-btn:hover { background: var(--bg2); transform: scale(1.2); }
  .vocab-fav-btn.active { color: #f5a623; }
  .vocab-fav-btn.pop { animation: fav-pop 0.3s ease; }
  @keyframes fav-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.4); }
    100% { transform: scale(1); }
  }

  /* お気に入りジャンルタブ */
  .genre-btn.fav-tab { color: #f5a623; }
  .genre-btn.fav-tab.active { background: #fff7e6; border-color: #f5a623; color: #c47d00; }

  /* お気に入り空状態 */
  .fav-empty { text-align: center; padding: 40px 20px; color: var(--text3); font-size: 13px; line-height: 2; }
  .fav-empty-icon { font-size: 36px; margin-bottom: 10px; }

  /* ─────────────────────────────────────────
     LIVE / 改善 トグルスイッチ
  ───────────────────────────────────────── */
  .live-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 14px; background: var(--bg2); border-bottom: 1px solid var(--border);
  }
  .live-toggle-left { display: flex; align-items: center; gap: 8px; }
  .live-mode-label { font-size: 12px; font-weight: 700; min-width: 95px; transition: color 0.2s; }
  .live-mode-label.live    { color: var(--accent); }
  .live-mode-label.improve { color: var(--purple); }
  .toggle-switch {
    position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0;
  }
  .toggle-switch input { opacity: 0; width: 0; height: 0; }
  .toggle-knob {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--accent); border-radius: 13px; transition: background 0.2s;
  }
  .toggle-knob::before {
    content: ''; position: absolute; width: 20px; height: 20px;
    left: 3px; bottom: 3px; background: white; border-radius: 50%;
    transition: transform 0.2s; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  }
  .toggle-switch input:checked + .toggle-knob { background: var(--purple); }
  .toggle-switch input:checked + .toggle-knob::before { transform: translateX(20px); }
  .improve-check-btn {
    display: none; padding: 5px 12px; border-radius: 8px; border: none;
    background: var(--purple); color: white;
    font-family: 'Zen Maru Gothic', sans-serif; font-size: 12px; font-weight: 700;
    cursor: pointer; transition: opacity 0.15s; align-items: center; gap: 4px;
  }
  .improve-check-btn:hover { opacity: 0.85; }
  .improve-mode-on .improve-check-btn { display: inline-flex; }

  /* ─────────────────────────────────────────
     モバイル用アコーディオン共通スタイル
  ───────────────────────────────────────── */
  .mobile-accordion-toggle {
    display: none; /* デフォルト非表示、モバイルのみ表示 */
    align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border2);
    cursor: pointer;
    user-select: none; -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition-fast);
  }
  .mobile-accordion-toggle:active {
    background: var(--accent-light);
  }
  .mobile-accordion-toggle .wst-label {
    font-size: 12px; font-weight: 700; color: var(--text2);
  }
  .accordion-arrow {
    font-size: 10px; color: var(--text3);
    transition: transform 0.25s ease;
  }
  .accordion-body-area {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
  }

  /* ─────────────────────────────────────────
     スプリットハンドル（デフォルト非表示）
  ───────────────────────────────────────── */
  .split-handle { display: none; }

  /* モバイルジャンルセレクタ（デフォルト非表示） */
  .mobile-genre-bar { display: none; }

  /* ─────────────────────────────────────────
     モバイル全面刷新：可変スプリットレイアウト
  ───────────────────────────────────────── */
  @media (max-width: 767px) {
    .genre-bar { display: none; }

    /* 画面の固定を解除し、自然スクロールに戻す */
    body {
      height: auto;
      overflow: auto !important;
      display: block;
    }

    /* ヘッダーの余白を広げてスッキリさせる */
    .header { padding: 32px 16px 20px; }
    .header h1 { font-size: 18px; }
    .header p { font-size: 12px; margin-top: 8px; line-height: 1.6; }
    .header-how-to { font-size: 11px; padding: 10px 14px; margin-top: 12px; }

    .container {
      padding: 0 12px 60px;
      display: block;
      height: auto;
      overflow: visible;
    }

    /* カラム間の隙間を広げる */
    .main-layout {
      display: flex !important;
      flex-direction: column;
      gap: 24px;
    }

    /* 執筆エリアの制限解除（広々と書けるように） */
    .write-column {
      flex: none !important;
      width: 100%;
      max-height: none !important;
      overflow: visible !important;
    }
    .write-column #panel-write {
      display: block;
      height: auto;
    }
    #write-area {
      min-height: 160px !important;
      font-size: 16px;
      line-height: 1.8;
    }

    /* アコーディオン共通をモバイルで有効化 */
    .mobile-accordion-toggle {
      display: flex;
    }
    .accordion-body-area {
      max-height: 500px; opacity: 1;
    }
    .accordion-body-area.collapsed {
      max-height: 0; opacity: 0; overflow: hidden;
    }
    /* 備忘録セクションのボーダー調整 */
    .pin-section {
      border-top: 1px solid var(--border2);
    }

    /* スプリットハンドル不要 */
    .split-handle { display: none; }

    /* ツールエリアの制限解除と余白拡大 */
    .tool-column {
      display: block !important;
      flex: none !important;
      width: 100%;
      max-height: none !important;
      overflow: visible !important;
      position: static !important;
      border-top: none;
      padding-bottom: 20px;
    }

    /* タブやボタンの余白を広げて押しやすく、密集感を減らす */
    .tool-mode-tabs {
      flex-wrap: nowrap !important;
      overflow-x: auto !important;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      margin-bottom: 20px;
      padding: 6px;
    }
    .tool-mode-tabs::-webkit-scrollbar { display: none; }
    .tool-mode-tab {
      flex: 0 0 auto !important;
      white-space: nowrap !important;
      padding: 12px 16px;
      font-size: 13px;
    }
    #tool-tab-hint { display: none; }

    /* モバイル用ジャンルセレクタ */
    .mobile-genre-bar {
      display: flex; gap: 8px; padding: 10px;
      overflow-x: auto; -webkit-overflow-scrolling: touch;
      border-bottom: 1px solid var(--border2); flex-shrink: 0;
    }
    .mobile-genre-bar::-webkit-scrollbar { display: none; }
    .mobile-genre-bar .genre-btn {
      padding: 6px 12px; font-size: 12px; white-space: nowrap; flex-shrink: 0;
    }

    /* 密度バー・エディタフッターの余白 */
    .density-bar { padding: 8px 14px; }
    .editor-footer { padding: 8px 14px; }
  }

  /* Lucide SVGアイコン共通スタイル */
  .lucide-btn-icon {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    stroke-width: 2;
  }
  .lucide-tab-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
  }

  /* タップフィードバック（スマホ向けマイクロインタラクション） */
  button:active, .btn:active, .genre-btn:active, .tool-mode-tab:active,
  .vocab-btn:active, .tip-chip:active, .conj-chip:active, .demo-chip:active,
  .emo-word-btn:active, .emo-alt-chip:active, .editor-btn-labeled:active {
    transform: scale(0.95);
    transition: transform 0.08s ease;
  }


  /* ヘルプFABボタン（一番下） */
  .help-fab {
    position: fixed;
    bottom: 20px;
    right: 16px;
    z-index: 999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Zen Maru Gothic', sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .help-fab:hover { transform: scale(1.1); box-shadow: 0 4px 20px rgba(0,0,0,0.2); }

  /* 上に戻るFABボタン（スクロール時出現、一番上・控えめ） */
  .scroll-top-fab {
    position: fixed;
    bottom: 116px;
    right: 16px;
    z-index: 999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text3);
    border: 1px solid var(--border);
    font-size: 18px;
    font-weight: 700;
    font-family: 'Zen Maru Gothic', sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.9);
    pointer-events: none;
  }
  .scroll-top-fab.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
  .scroll-top-fab:hover {
    color: var(--accent);
    border-color: var(--accent);
  }

  /* ヘルプパネル */
  .help-panel {
    position: fixed;
    bottom: 70px;
    right: 16px;
    z-index: 999;
    width: 300px;
    max-height: 420px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    flex-direction: column;
    overflow: hidden;
    font-family: 'Zen Maru Gothic', sans-serif;
  }
  .help-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
  }
  .help-panel-list {
    list-style: none;
    padding: 12px 16px;
    margin: 0;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.8;
    color: var(--text2);
  }
  .help-panel-list li {
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
  }
  .help-panel-list li:last-child {
    border-bottom: none;
  }
  .help-panel-list strong {
    color: var(--text);
  }

  @media (max-width: 600px) {
    .help-panel {
      width: calc(100vw - 32px);
      right: 16px;
    }
  }

  /* ===== 感想カードテンプレ選択 ===== */
  .card-tmpl-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 18px 14px;
  }
  .card-tmpl-option {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, transform 0.15s;
    font-family: 'Zen Maru Gothic', sans-serif;
  }
  .card-tmpl-option:hover { transform: scale(1.03); }
  .card-tmpl-option.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
  }
  .card-tmpl-preview {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 6px;
    overflow: hidden;
  }
  .card-tmpl-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
  }

  /* プレビューサムネイル */
  .card-preview-simple {
    background: #fff;
    border: 1px solid #e8ddd4;
    color: #5a4a3a;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 16px;
    font-weight: 600;
  }
  .card-preview-ticket {
    background: linear-gradient(135deg, #fdf6ed 0%, #f5e6d3 100%);
    border: 2px dashed #c9a96e;
    font-size: 24px;
  }
  .card-preview-letter {
    background: repeating-linear-gradient(
      transparent, transparent 17px, #c8d8e8 17px, #c8d8e8 18px
    ), #fdfaf5;
    border-left: 4px solid #e07070;
    font-size: 24px;
    position: relative;
  }
  .card-preview-neon {
    background: #1a1a2e;
    color: #0ff;
    text-shadow: 0 0 8px #0ff, 0 0 20px #0ff;
    font-size: 20px;
  }

  /* ===== エクスポート用カードテンプレ ===== */
  .export-card {
    width: 680px;
    font-family: 'Zen Maru Gothic', sans-serif;
    box-sizing: border-box;
  }
  .export-card .export-body {
    font-size: 17px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-weight: 500;
  }

  /* シンプル */
  .export-card-simple {
    padding: 40px;
    background: #fdf8f4;
  }
  .export-card-simple .export-inner {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(77,58,48,0.08);
    border: 1px solid #e8ddd4;
  }
  .export-card-simple .export-body { color: #4d3a30; }
  .export-card-simple .export-footer {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #e8ddd4;
    font-size: 11px;
    color: #b39a82;
    text-align: right;
  }

  /* チケット風 */
  .export-card-ticket {
    padding: 40px;
    background: linear-gradient(135deg, #fdf6ed 0%, #f5e6d3 50%, #fdf6ed 100%);
  }
  .export-card-ticket .export-inner {
    background: #fffcf7;
    border-radius: 4px;
    padding: 0;
    border: 2px solid #c9a96e;
    position: relative;
    overflow: visible;
  }
  .export-card-ticket .ticket-header {
    background: linear-gradient(90deg, #c9a96e, #b8873a);
    color: #fff;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .export-card-ticket .ticket-header .ticket-icon { font-size: 18px; }
  .export-card-ticket .ticket-body-wrap {
    padding: 28px 30px;
    border-top: 2px dashed #c9a96e;
  }
  .export-card-ticket .export-body { color: #4d3a30; }
  .export-card-ticket .ticket-tear {
    display: flex;
    align-items: center;
    gap: 0;
  }
  .export-card-ticket .ticket-tear-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fdf6ed, #f5e6d3);
    flex-shrink: 0;
  }
  .export-card-ticket .ticket-tear-line {
    flex: 1;
    border-top: 2px dashed #c9a96e;
  }
  .export-card-ticket .ticket-footer {
    padding: 10px 24px 14px;
    font-size: 11px;
    color: #b8873a;
    text-align: right;
    font-weight: 500;
  }

  /* 便箋風 */
  .export-card-letter {
    padding: 40px;
    background: #f0ece4;
  }
  .export-card-letter .export-inner {
    background:
      repeating-linear-gradient(
        transparent, transparent 31px, #c8d8e8 31px, #c8d8e8 32px
      ),
      #fdfaf5;
    padding: 0;
    box-shadow: 0 3px 16px rgba(0,0,0,0.08);
    border: 1px solid #ddd8d0;
    position: relative;
  }
  .export-card-letter .letter-margin {
    position: absolute;
    top: 0; bottom: 0; left: 46px;
    width: 0;
    border-left: 2px solid #e07070;
    opacity: 0.6;
  }
  .export-card-letter .letter-body-wrap {
    padding: 20px 32px 24px 62px;
  }
  .export-card-letter .export-body {
    color: #2c3e50;
    font-family: 'Shippori Mincho', serif;
    line-height: 32px;
  }
  .export-card-letter .letter-date {
    text-align: right;
    padding: 8px 32px 16px 62px;
    font-size: 12px;
    color: #8a8078;
    font-family: 'Shippori Mincho', serif;
    font-style: italic;
  }

  /* ネオンサイン風 */
  .export-card-neon {
    padding: 40px;
    background: #0d0d1a;
  }
  .export-card-neon .export-inner {
    background: linear-gradient(145deg, #141428, #1a1a35);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid rgba(100, 100, 255, 0.15);
    box-shadow: 0 0 40px rgba(100, 100, 255, 0.08), inset 0 1px 0 rgba(255,255,255,0.05);
  }
  .export-card-neon .export-body {
    color: #e0e0ff;
    text-shadow: 0 0 10px rgba(140, 120, 255, 0.3);
  }
  .export-card-neon .neon-accent {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ff6ec7, #7b68ee, #00d4ff);
    border-radius: 2px;
    margin-bottom: 24px;
    box-shadow: 0 0 12px rgba(123,104,238,0.5);
  }
  .export-card-neon .neon-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(100, 100, 255, 0.12);
    font-size: 11px;
    color: rgba(160,160,220,0.6);
    text-align: right;
  }

  .export-watermark {
    margin-top: 8px;
    text-align: center;
    font-size: 9px;
    color: rgba(150,150,150,0.45);
    letter-spacing: 0.5px;
  }

/* ===== フッター ===== */
.site-footer {
  text-align: center;
  padding: 32px 16px 40px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
}
.footer-links a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
.footer-links a:hover {
  text-decoration: underline;
  opacity: 0.8;
}
.footer-links span {
  color: var(--border);
}
.footer-copy {
  font-size: 11px;
  color: var(--text3);
  font-family: 'Zen Maru Gothic', sans-serif;
}

/* ===== ① iOS Safariのズームバグ完全防止 ===== */
input, input[type="text"], input[type="search"], textarea, select {
  font-size: 16px !important;
}

/* ===== ② スマホ時のFABボタンサイズ拡大 ===== */
@media (max-width: 767px) {
  .help-fab,
  .scroll-top-fab {
    width: 56px !important;
    height: 56px !important;
    font-size: 22px !important;
  }
  .help-fab { bottom: 20px !important; }
  .scroll-top-fab { bottom: 84px !important; }
}

/* ===== ③ 画像エクスポート：長文時の16:9ワイドレイアウト ===== */
.export-card.format-16-9 {
  width: 1200px !important;
  min-height: 675px;
}
.export-card.format-16-9 .export-body {
  font-size: 30px;
  line-height: 1.8;
}

/* ===== 執筆エリア固定高さ（自動リサイズ廃止） ===== */
#write-area {
  height: 250px !important;
  min-height: 150px !important;
  resize: vertical !important;
  overflow-y: auto !important;
}
@media (max-width: 767px) {
  #write-area {
    height: 180px !important;
  }
}

/* ===== 語彙カテゴリ目次 ===== */
.vocab-toc-container {
  display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 10px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.vocab-toc-container::-webkit-scrollbar { display: none; }
.vocab-toc-btn {
  flex-shrink: 0; padding: 4px 10px; border-radius: 12px;
  border: 1px solid var(--border2); background: var(--bg2);
  font-family: 'Zen Maru Gothic', sans-serif; font-size: 11px; font-weight: 700;
  color: var(--text3); cursor: pointer; transition: all 0.15s;
}
.vocab-toc-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* ===== Lucideアイコン統一スタイル ===== */
.modal-title-icon { width: 18px; height: 18px; color: var(--accent); vertical-align: -3px; margin-right: 4px; }
.card-title-icon { width: 16px; height: 16px; color: var(--accent); vertical-align: -2px; margin-right: 2px; }
.modal-title { display: flex; align-items: center; gap: 4px; }

/* トーストアイコン */
#toast { display: flex; align-items: center; gap: 8px; }
#toast .toast-icon { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }

/* ローディングスピナー */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* 執筆エリアのボタンホバー強化 */
.editor-btns .btn-ghost {
  transition: all 0.2s ease;
}
.editor-btns .btn-ghost:hover {
  background-color: var(--accent-light);
  border-color: var(--accent2);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow3);
}

/* ===== PC環境のモーダル最適化（中央配置・四隅角丸） ===== */
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-sheet {
    border-radius: 16px;
    max-height: 85vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: popInModal 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes popInModal {
    from {
      opacity: 0;
      transform: scale(0.96) translateY(20px);
    }
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }
}

/* ===== モバイル版タイトルロゴのサイズ拡大 ===== */
@media (max-width: 767px) {
  .header h1 {
    font-size: 24px !important;
  }
}

/* ===== 推しポイント備忘録のPC表示・開閉対応 ===== */
.mobile-accordion-toggle {
  display: flex !important;
}
.accordion-body-area {
  max-height: 500px;
  opacity: 1;
}
.accordion-body-area.collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
}
