/* CSP strict 用: app.js が innerHTML で挿入する HTML 内のインライン style="margin-top:10px"
   を CSS クラスに置き換えるためのもの。strict CSP (style-src 'self'、'unsafe-inline' なし)
   下では innerHTML 経由の inline style 属性も拒否されるため、クラス参照に変えて回避する。
   .initially-hidden の定義および解説は本ファイル末尾を参照。 */
.warn-spaced { margin-top: 10px; }

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

  :root {
    --bg: #1a1a1a;
    --bg-elevated: #222;
    --bg-hover: #2a2a2a;
    --bg-active: #333;
    --fg: #e4e4e4;
    --fg-dim: #888;
    --fg-faint: #555;
    --accent: #7dd3c0;
    --border: #2a2a2a;
    --modified: #e8b842;
    --danger: #e57373;
    --tree-font-size: 12.5px;
    --ui-font-delta: 0px;  /* Sys Font S=0px, M=+2px, L=+4px, XL=+7px */
    --glow-color: transparent;
  }

  /* Themes (calm = default, plus 5 neon variants) — Tsui Clock 互換パレット */
  html[data-theme="green"]  { --accent:#39ff77; --glow-color:#39ff77; }
  html[data-theme="amber"]  { --accent:#ffb000; --glow-color:#ffb000; }
  html[data-theme="red"]    { --accent:#ffc0b8; --glow-color:#ff2020; }
  html[data-theme="pink"]   { --accent:#ffc8f0; --glow-color:#ff26b3; }
  html[data-theme="cyber"]  { --accent:#B2FFCA; --glow-color:#39ff77; }

  /* Glow: 静的な見出し系に限定 (編集中の active 要素には付けない) */
  html[data-theme] .title,
  html[data-theme] .modal-body h3,
  html[data-theme] .modal-body .app-name {
    text-shadow: 0 0 8px var(--glow-color), 0 0 16px var(--glow-color);
  }

  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
    background: var(--bg);
    color: var(--fg);
    height: 100vh;        /* フォールバック（超旧ブラウザ用） */
    height: 100dvh;       /* モバイルブラウザのUI表示/非表示に追従 */
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    font-size: 13px;
  }

  header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: calc(12px + var(--ui-font-delta));
    background: var(--bg-elevated);
    min-width: 0;
  }
  header button {
    padding: calc(5px + var(--ui-font-delta) / 2) calc(12px + var(--ui-font-delta));
    font-size: calc(12px + var(--ui-font-delta));
  }
  header .folder-path { font-size: calc(12px + var(--ui-font-delta)); }

  .title { font-weight: 600; letter-spacing: 1px; font-size: 12px; color: var(--accent); flex-shrink: 0; }

  .folder-path {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
    color: var(--fg-dim);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
  }
  button:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--accent); }
  button:disabled { opacity: 0.35; cursor: not-allowed; }
  button.primary { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 600; }
  button.primary:hover:not(:disabled) { background: #9ae0d0; }
  button.reconnect { border-color: var(--modified); color: var(--modified); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
  button.reconnect:hover { background: rgba(232, 184, 66, 0.1); }

  .sidebar-toggle {
    padding: 4px 9px;
    font-size: 15px;
    line-height: 1;
    color: var(--fg-dim);
  }
  .sidebar-toggle:hover { color: var(--accent); }

  main {
    display: grid;
    grid-template-columns: 260px 1fr;
    overflow: hidden;
    position: relative;
  }

  body.sidebar-hidden main { grid-template-columns: 1fr; }
  body.sidebar-hidden #sidebar { display: none; }

  #sidebar-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99;
  }

  #sidebar {
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .sidebar-toolbar {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .icon-btn {
    padding: 3px 8px;
    font-size: calc(11px + var(--ui-font-delta));
    color: var(--fg-dim);
    border-color: transparent;
  }
  .icon-btn:hover:not(:disabled) {
    color: var(--fg);
    background: var(--bg-hover);
    border-color: var(--border);
  }

  #tree-container {
    flex: 1;
    overflow: auto;
    padding: 6px 0;
    position: relative;
  }

  /* ==== Sidebar settings ==== */
  .sidebar-settings {
    border-top: 1px solid var(--border);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    background: var(--bg-elevated);
  }
  .settings-label {
    font-size: calc(9.5px + var(--ui-font-delta));
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--fg-faint);
    text-transform: uppercase;
  }
  .font-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg);
    border-color: var(--border);
    background: transparent;
  }
  .font-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
  }
  .font-btn:disabled {
    opacity: 0.3;
  }
  #font-size-display {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    min-width: 36px;
    text-align: center;
    color: var(--fg);
  }
  .settings-reset {
    margin-left: auto;
    font-size: 10px;
    color: var(--fg-faint);
    cursor: pointer;
    user-select: none;
    padding: 2px 4px;
    border-radius: 3px;
  }
  .settings-reset:hover { color: var(--fg-dim); background: var(--bg-hover); }

  .sidebar-settings + .sidebar-settings {
    border-top: none;
    padding-top: 0;
  }

  .tree-size-btn {
    width: 30px;
    height: 24px;
    padding: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-dim);
    border: 1px solid var(--border);
    background: transparent;
    letter-spacing: 0.5px;
  }
  .tree-size-btn:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--fg);
    border-color: var(--accent);
  }
  .tree-size-btn.active {
    background: var(--accent);
    color: #111;
    border-color: var(--accent);
  }

  /* Wrap toggle (Wrap / Scroll) — tree-size-btn と同じ見た目、横幅は文字に合わせる */
  .wrap-btn {
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-dim);
    border: 1px solid var(--border);
    background: transparent;
    letter-spacing: 0.5px;
  }
  .wrap-btn:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--fg);
    border-color: var(--accent);
  }
  .wrap-btn.active {
    background: var(--accent);
    color: #111;
    border-color: var(--accent);
  }

  /* Theme color dots — 6色をドットで並べる */
  .theme-dot {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--theme-dot-color, var(--fg-dim));
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s;
    flex-shrink: 0;
  }
  .theme-dot[data-theme="calm"]  { --theme-dot-color: #7dd3c0; }
  .theme-dot[data-theme="green"] { --theme-dot-color: #39ff77; }
  .theme-dot[data-theme="amber"] { --theme-dot-color: #ffb000; }
  .theme-dot[data-theme="red"]   { --theme-dot-color: #ff2020; }
  .theme-dot[data-theme="pink"]  { --theme-dot-color: #ff26b3; }
  .theme-dot[data-theme="cyber"] { --theme-dot-color: #B2FFCA; }
  .theme-dot:hover:not(.active) {
    transform: scale(1.15);
    border-color: var(--fg-dim);
  }
  .theme-dot.active {
    border-color: var(--fg);
    box-shadow: 0 0 0 1.5px var(--bg-elevated), 0 0 0 3px var(--theme-dot-color);
  }

  .about-row {
    border-top: 1px solid var(--border);
    padding: 8px 10px;
    font-size: 10.5px;
    color: var(--fg-faint);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-elevated);
    flex-shrink: 0;
  }
  .about-link {
    cursor: pointer;
    user-select: none;
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--fg-dim);
  }
  .about-link:hover { color: var(--accent); background: var(--bg-hover); }
  .about-version {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 10px;
  }

  .readonly-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--modified);
    border: 1px solid var(--modified);
    border-radius: 3px;
    margin-left: 8px;
  }

  /* ==== Tree ==== */
  .tree-node {
    padding: 3px 4px 3px 0;
    cursor: pointer;
    user-select: none;
    font-size: var(--tree-font-size);
    display: flex;
    align-items: center;
    white-space: nowrap;
    line-height: 1.4;
  }
  .tree-node:hover { background: var(--bg-hover); }
  .tree-node.active { background: var(--bg-active); color: var(--accent); }
  .tree-node.open-in-tab { color: var(--fg); }

  .tree-icon {
    display: inline-block;
    width: 14px;
    margin-right: 4px;
    color: var(--fg-faint);
    font-size: 0.8em;
    flex-shrink: 0;
    text-align: center;
  }

  .tree-label { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }

  /* 右端の⋮メニューボタン（デスクトップではホバー時のみ表示） */
  .tree-menu-btn {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    margin-left: 4px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--fg-dim);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.1s, background 0.1s, border-color 0.1s;
  }
  .tree-node:hover .tree-menu-btn,
  .tree-menu-btn:focus { opacity: 1; }
  .tree-menu-btn:hover {
    background: var(--bg-active);
    border-color: var(--border);
    color: var(--fg);
  }

  .tree-edit-input {
    background: var(--bg);
    border: 1px solid var(--accent);
    color: var(--fg);
    padding: 1px 4px;
    font-size: var(--tree-font-size);
    font-family: inherit;
    outline: none;
    flex: 1;
    min-width: 0;
  }

  .tree-node-actions {
    display: none;
    gap: 0;
    flex-shrink: 0;
    padding-left: 4px;
  }
  .tree-node:hover .tree-node-actions { display: flex; }
  body.dragging .tree-node-actions { display: none !important; }

  .tree-action-btn {
    width: 22px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 10px;
    color: var(--fg-dim);
    cursor: pointer;
    user-select: none;
    letter-spacing: -0.5px;
  }
  .tree-action-btn:hover { background: var(--bg-active); color: var(--accent); }

  .tree-node.drop-target {
    background: rgba(125, 211, 192, 0.18) !important;
    box-shadow: inset 0 0 0 1px var(--accent);
  }
  #tree-container.drop-target-root {
    box-shadow: inset 0 0 0 2px var(--accent);
  }

  /* ==== Editor area ==== */
  #editor-area { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

  .tab-bar {
    display: flex;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    min-height: 33px;
    scrollbar-width: thin;
    flex-shrink: 0;
  }
  .tab-bar:empty { display: none; }
  .tab-bar::-webkit-scrollbar { height: 4px; }
  .tab-bar::-webkit-scrollbar-thumb { background: var(--border); }

  .tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px 0 12px;
    border-right: 1px solid var(--border);
    cursor: pointer;
    font-size: calc(12px + var(--ui-font-delta));
    color: var(--fg-dim);
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
    height: calc(32px + var(--ui-font-delta) * 1.5);
    max-width: 220px;
  }
  .tab:hover { background: var(--bg-hover); color: var(--fg); }
  .tab.active { background: var(--bg); color: var(--fg); }

  .tab-name { overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
  .tab-modified { color: var(--modified); font-size: 10px; line-height: 1; }

  .tab-close {
    width: calc(16px + var(--ui-font-delta));
    height: calc(16px + var(--ui-font-delta));
    display: flex; align-items: center; justify-content: center;
    border-radius: 3px;
    font-size: calc(14px + var(--ui-font-delta));
    color: var(--fg-faint);
    margin-left: 2px;
  }
  .tab-close:hover { background: var(--bg-active); color: var(--fg); }

  .editor-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
  }

  #editor {
    flex: 1;
    background: var(--bg);
    color: var(--fg);
    border: none;
    padding: 14px 18px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    line-height: 1.65;
    resize: none;
    outline: none;
    tab-size: 2;
    white-space: pre;
  }
  #editor:disabled { color: var(--fg-faint); }

  /* Wrap mode (default ON) — 長い行をエディタ幅で折り返す */
  body.wrap-on #editor {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .editor-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    color: var(--fg-faint);
    font-size: 13px;
    pointer-events: none;
    text-align: center;
    padding: 20px;
    line-height: 1.8;
    background: var(--bg);
  }
  .editor-empty .title-large {
    font-size: 15px;
    color: var(--fg-dim);
    letter-spacing: 0.5px;
  }
  .editor-empty .hint {
    font-size: 11.5px;
    color: var(--fg-faint);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
  }

  footer {
    padding: 5px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    font-size: calc(11px + var(--ui-font-delta));
    color: var(--fg-dim);
    display: flex;
    gap: 16px;
    align-items: center;
    overflow: hidden;
  }
  #status-info { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .footer-hint { white-space: nowrap; flex-shrink: 0; }

  .empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--fg-faint);
    font-size: 12px;
    padding: 20px;
    text-align: center;
    line-height: 1.9;
  }

  .kbd {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    background: var(--bg-active);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10.5px;
    border: 1px solid var(--border);
  }

  .unsupported { max-width: 480px; text-align: center; line-height: 1.8; margin: 80px auto; padding: 20px; }
  .unsupported h2 { color: var(--modified); margin-bottom: 12px; font-size: 16px; }
  .unsupported p { color: var(--fg-dim); font-size: 13px; }

  .context-menu {
    position: fixed;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 1000;
    display: none;
  }
  .context-item {
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    color: var(--fg);
    user-select: none;
  }
  .context-item:hover { background: var(--bg-hover); }
  .context-item.danger { color: var(--danger); }
  .context-item.danger:hover { background: rgba(229, 115, 115, 0.12); }
  .context-separator { height: 1px; background: var(--border); margin: 4px 2px; }

  /* ==== Footer indicators ==== */
  .footer-pill {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: calc(10.5px + var(--ui-font-delta));
    padding: 1px 7px;
    border-radius: 3px;
    border: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    color: var(--fg-dim);
    background: transparent;
    flex-shrink: 0;
  }
  .footer-pill:hover { color: var(--fg); border-color: var(--accent); }
  .footer-pill.readonly { color: var(--modified); border-color: var(--modified); }

  /* ==== About button in sidebar ==== */
  .sidebar-about {
    border-top: 1px solid var(--border);
    padding: 7px 10px;
    font-size: calc(10.5px + var(--ui-font-delta));
    color: var(--fg-faint);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    background: var(--bg-elevated);
  }
  .sidebar-about:hover { color: var(--accent); background: var(--bg-hover); }

  /* ==== Modal (About dialog) ==== */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .modal-backdrop.open { display: flex; }
  .modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  }
  .modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .modal-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent);
    letter-spacing: 0.5px;
  }
  .modal-close {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    color: var(--fg-dim);
    border-color: transparent;
  }
  .modal-close:hover { color: var(--fg); background: var(--bg-hover); }
  .modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    color: var(--fg);
    font-size: 12.5px;
    line-height: 1.75;
  }
  .modal-body h3 {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--accent);
    text-transform: uppercase;
    margin: 18px 0 6px;
  }
  .modal-body h3:first-child { margin-top: 0; }
  .modal-body p { color: var(--fg-dim); margin-bottom: 2px; }
  .modal-body .version-line {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    color: var(--fg-faint);
    margin-bottom: 16px;
  }
  .modal-body .app-name {
    font-size: 16px;
    color: var(--fg);
    font-weight: 600;
    margin-bottom: 2px;
  }
  .modal-body .license-text {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 10.5px;
    line-height: 1.6;
    color: var(--fg-dim);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px 12px;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .modal-body .author-line {
    font-size: 11px;
    color: var(--fg-dim);
    margin-bottom: 8px;
  }
  .modal-body a {
    color: var(--accent);
    text-decoration: none;
  }
  .modal-body a:hover { text-decoration: underline; }
  .modal-body code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.92em;
    color: var(--fg);
  }
  .modal-body ul {
    padding-left: 1.4em;
    margin: 4px 0 8px;
  }
  .modal-body li {
    color: var(--fg-dim);
    margin-bottom: 2px;
  }

  /* ==== Mobile ==== */
  @media (max-width: 768px) {
    /* ヘッダー: タップ標的 min-height 44px、ボタン間隔を広めに */
    header { padding: 8px 10px; gap: calc(10px + var(--ui-font-delta)); }
    .title { display: none; }
    header button {
      padding: calc(9px + var(--ui-font-delta) / 2) calc(14px + var(--ui-font-delta));
      font-size: calc(13px + var(--ui-font-delta));
      min-height: 40px;
    }
    #btn-reconnect { max-width: 130px; }
    header .folder-path { font-size: calc(11px + var(--ui-font-delta)); }

    main { grid-template-columns: 1fr; }

    #sidebar {
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 80%;
      max-width: 320px;
      z-index: 100;
      box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    body:not(.sidebar-hidden) #sidebar-backdrop { display: block; }

    footer { padding: 5px 10px; font-size: calc(10px + var(--ui-font-delta)); gap: 8px; }
    .footer-hint { display: none; }

    .tree-node-actions { display: flex; }
    .tree-action-btn { width: 26px; height: 22px; font-size: calc(11px + var(--ui-font-delta)); }

    /* モバイルでは⋮を常時表示（タップ標的を明示） */
    .tree-menu-btn { opacity: 1; width: 32px; height: 32px; font-size: calc(18px + var(--ui-font-delta)); }

    /* モバイルブラウザのURLバー／ナビバー／ホームインジケータで下端が
       隠れないよう、ABOUT とフッターに安全余白を足す */
    .sidebar-about {
      padding-bottom: calc(7px + 3em + env(safe-area-inset-bottom, 0px));
    }
    footer {
      padding-bottom: calc(5px + env(safe-area-inset-bottom, 0px));
    }
  }

  /* ==== Folder warning modal ================================================ */
  .warn-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; padding: 20px;
  }
  .warn-modal {
    background: var(--bg-elevated); border: 1px solid var(--danger);
    border-radius: 8px; padding: 24px; max-width: 520px; width: 100%;
    color: var(--fg); font-size: 13px; line-height: 1.7;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  }
  .warn-modal h2 {
    color: var(--danger); font-size: 15px; margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
  }
  .warn-modal p { margin: 6px 0; }
  .warn-modal ul { margin: 8px 0 12px 20px; color: var(--fg-dim); }
  .warn-modal li { margin: 2px 0; }
  .warn-modal code {
    background: var(--bg); padding: 1px 6px; border-radius: 3px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
    color: var(--accent);
  }
  .warn-modal .warn-note {
    color: var(--fg-dim); font-size: 12px; margin-top: 10px;
    padding-top: 10px; border-top: 1px solid var(--border);
  }
  .warn-modal .warn-actions {
    display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px;
  }

/* CSP strict 用 — 初期非表示クラス (末尾配置 + セレクタ二重で詳細度 0,2,0 を確保し、
   .sidebar-toolbar 等の他クラスの display: 指定にも勝つように設計).
   表示する側の JS は element.style.display = '' 単独では勝てない (inline style を空に
   するだけで author CSS の display: none がそのまま効く) ため、必ず classList.remove
   ('initially-hidden') とセットで行う必要がある (app.js の revealHidden ヘルパー参照). */
.initially-hidden.initially-hidden { display: none; }
