@charset 'utf-8';

/*
 * 色のトークン（gen / otr 共通）。すべてのビューが normalize.css の直後に読む。
 *
 * - トークンは「役割」で名付ける（--text-muted など）。色の名前（--gray-888）にはしない。
 * - ニュートラルは数字が大きいほどページ背景とのコントラストが弱い
 *   （--surface-2 は --surface より灰色、--text-2 は --text より薄い）。
 * - アクセント・状態色の接尾辞: 無印 = 基本 / -2 = 少し濃い / -strong = 文字向けの濃い色 /
 *   -light = 明るめ / -soft = 薄い罫線・塗り / -bg = 薄い背景。
 * - 値は置き換え前のリテラルと完全に同じにしてある（見た目を変えないため）。
 *   置き換えは「リテラル == トークン値」のときだけ行う（docs/claude/tools/tokenize_css.mjs）。
 * - ダークテーマは html[data-theme="dark"] のブロックで上書きする（切替はサイドメニュー下部。localStorage の theme）。
 *   トークンを足すときはダーク値も足すこと。-strong は「文字として読める濃さ」なのでダークでは明るくなる。
 *   --surface-inverse（ツールチップ・編集画面の暗いメニュー）はダークでも暗いまま、少しだけ明るくして浮かせる。
 * - このファイルには :root（と将来のテーマ）ブロックの --変数 だけを置く（npm run review が見ている）。
 * - フォールバック var(--x, #fff) は書かない（link 漏れが隠れ、typo の検出もできなくなる）。
 */
:root {
  /* ページ */
  --bg: #fcfcfc;
  --text-body: #212121;

  /* 面（カード・パネル・入力欄の背景） */
  --surface: #fff;
  --surface-2: #f5f5f5;
  --surface-3: #fafafa;
  --surface-muted: #e0e0e0;
  --surface-disabled: #ccc;
  --surface-inverse: #333;     /* ツールチップ・暗いパネル（ページと反対の明るさ） */
  --surface-inverse-2: #777;   /* 灰色のボタン */
  --surface-glass: rgba(255, 255, 255, 0.9);    /* 背景写真の上に置く半透明の面（絞り込み・カード） */
  --surface-glass-2: rgba(255, 255, 255, 0.7);  /* 同上、薄め */

  /* 文字 */
  --text: #333;
  --text-2: #555;
  --text-3: #666;
  --text-muted: #888;
  --text-faint: #999;
  --text-disabled: #aaa;
  --on-accent: #fff;
  --on-warning: #fff;           /* --warning-strong の面の上の文字 */

  /* 罫線 */
  --border: #e0e0e0;
  --border-2: #ddd;
  --border-3: #ccc;

  /* アクセント（LINE設定・リッチメニューのティール） */
  --accent: #01a7a4;
  --accent-2: #0d9488;
  --accent-strong: #0f766e;
  --accent-bg: #f0fdfa;
  --accent-bg-2: #e0f7fa;
  --accent-soft: #b2dfdb;

  /* リッチメニューのタブセット（藍色） */
  --tabset: #818cf8;
  --tabset-strong: #3730a3;
  --tabset-soft: #c7d2fe;
  --tabset-bg: #eef2ff;

  /* 成功（緑） */
  --success: #4caf50;
  --success-light: #66bb6a;
  --success-2: #388e3c;
  --success-strong: #2e7d32;
  --success-soft: #c8e6c9;
  --success-bg: #e8f5e9;
  --success-bg-2: #f1f8e9;

  /* 危険（赤） */
  --danger: #d32f2f;
  --danger-strong: #c62828;
  --danger-soft: #ffcdd2;
  --danger-bg: #ffebee;

  /* 情報（青） */
  --info: #1e88e5;
  --info-strong: #1565c0;
  --info-bg: #e3f2fd;

  /* 警告（オレンジ） */
  --warning: #ff9800;
  --warning-strong: #f57c00;
  --warning-bg: #fff3e0;

  /* composer（合成エディター）のクローム。元から暗いのでテーマで変えない（ダークのブロックにも同じ値を置く） */
  --cmp-bg: #2a2a2a;
  --cmp-surface: #3a3a3a;
  --cmp-surface-2: #333;
  --cmp-surface-3: #444;
  --cmp-surface-4: #555;
  --cmp-border: #444;
  --cmp-border-2: #555;
  --cmp-text: #fff;
  --cmp-text-2: #ddd;
  --cmp-text-3: #ccc;
  --cmp-text-muted: #aaa;
  --cmp-text-faint: #888;
  --cmp-accent: #0fc9e7;
  --cmp-accent-2: #4a6fa5;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #15181c;
  --text-body: #e6e8eb;

  --surface: #1e2227;
  --surface-2: #262b31;
  --surface-3: #22262b;
  --surface-muted: #2f353d;
  --surface-disabled: #3d444d;
  --surface-inverse: #3a3f46;
  --surface-inverse-2: #5a616b;
  --surface-glass: rgba(30, 34, 39, 0.9);
  --surface-glass-2: rgba(30, 34, 39, 0.75);

  --text: #e3e5e8;
  --text-2: #c6cad0;
  --text-3: #aeb3ba;
  --text-muted: #8f959d;
  --text-faint: #767c85;
  --text-disabled: #5e656e;
  --on-accent: #fff;
  --on-warning: #2a1800;        /* ダークの --warning-strong は明るいオレンジなので、上の文字は暗く */

  --border: #30363e;
  --border-2: #363d46;
  --border-3: #414952;

  /* 無印と -2 は白文字のボタン背景にも使うので、ダークでも明るくしすぎない */
  --accent: #0fa39f;
  --accent-2: #0f9f94;
  --accent-strong: #5eead4;
  --accent-bg: #10302e;
  --accent-bg-2: #0f3236;
  --accent-soft: #1f4d4a;

  --tabset: #818cf8;
  --tabset-strong: #c7d2fe;
  --tabset-soft: #3b3f8a;
  --tabset-bg: #1e2140;

  --success: #4caf50;
  --success-light: #66bb6a;
  --success-2: #81c784;
  --success-strong: #a5d6a7;
  --success-soft: #2e5a33;
  --success-bg: #16301a;
  --success-bg-2: #1a2e1c;

  --danger: #ef5350;
  --danger-strong: #ef9a9a;
  --danger-soft: #5a2a2a;
  --danger-bg: #3a1c1c;

  --info: #1e88e5;
  --info-strong: #90caf9;
  --info-bg: #142a3f;

  --warning: #fb8c00;
  --warning-strong: #ffb74d;
  --warning-bg: #3a2a12;

  /* composer はテーマで変えない（:root と同じ値） */
  --cmp-bg: #2a2a2a;
  --cmp-surface: #3a3a3a;
  --cmp-surface-2: #333;
  --cmp-surface-3: #444;
  --cmp-surface-4: #555;
  --cmp-border: #444;
  --cmp-border-2: #555;
  --cmp-text: #fff;
  --cmp-text-2: #ddd;
  --cmp-text-3: #ccc;
  --cmp-text-muted: #aaa;
  --cmp-text-faint: #888;
  --cmp-accent: #0fc9e7;
  --cmp-accent-2: #4a6fa5;
}
