/* ToT 共通の土台スタイル。サイト共通の /css/common.css の後に読み込む。
   白基調・主操作は青・成功は緑・エラーは赤＋文字。common.css に合わせてダークモードにも対応。 */
:root {
  --tot-surface: #f6f8fb;
  --tot-field-bg: #ffffff;
  --tot-border: #d6dce5;
  --tot-input-border: #9aa5b5;
  --tot-text: #1a2230;
  --tot-muted: #5a6575;
  --tot-primary: #1d5fd1;
  --tot-primary-hover: #164ba8;
  --tot-primary-soft: #e8f0fd;
  --tot-on-primary: #ffffff;
  --tot-success: #157347;
  --tot-success-text: #0f5132;
  --tot-success-soft: #e7f5ee;
  --tot-danger: #b42318;
  --tot-danger-soft: #fdecea;
  --tot-focus: #f2a900;
  --tot-radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --tot-surface: #20242b;
    --tot-field-bg: #15181d;
    --tot-border: #3a414c;
    --tot-input-border: #5c6675;
    --tot-text: #e8ecf2;
    --tot-muted: #a7b0bd;
    --tot-primary: #6ea2ff;
    --tot-primary-hover: #8fb7ff;
    --tot-primary-soft: #1d2a40;
    --tot-on-primary: #0b1220;
    --tot-success: #4cc38a;
    --tot-success-text: #9be0bd;
    --tot-success-soft: #15291f;
    --tot-danger: #ff8a7a;
    --tot-danger-soft: #3a1d1a;
  }
}

.tot-main *, .tot-main *::before, .tot-main *::after { box-sizing: border-box; }

.tot-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 16px 64px;
  color: var(--tot-text);
  font-size: 16px;
  line-height: 1.7;
}
.tot-main a { color: var(--tot-primary); }
/* ツールの表示部分。中の2列・1列の切り替えは画面幅ではなくこの幅で決める（@container tot-tool。作業画面の並べて表示の片側でも合う） */
.tot-tool { container: tot-tool / inline-size; }
.tot-main :focus-visible { outline: 3px solid var(--tot-focus); outline-offset: 2px; }

.tot-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.tot-main [hidden] { display: none !important; }

/* ── パンくず ── */
.tot-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--tot-muted);
}
.tot-crumbs li + li::before { content: "›"; margin-right: 6px; }
.tot-crumbs a { color: var(--tot-muted); text-decoration: none; }
.tot-crumbs a:hover { text-decoration: underline; }

/* ── タイトル ── */
.tot-version {
  display: inline-block;
  margin-bottom: 4px;
  padding: 0 8px;
  border: 1px solid var(--tot-border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--tot-muted);
}
.tot-main .tot-open-tab {
  display: inline-flex; align-items: center; min-height: 36px; margin-left: 8px; padding: 2px 12px;
  border: 1px solid var(--tot-primary); border-radius: var(--tot-radius);
  font-size: 14px; font-weight: 600; text-decoration: none; vertical-align: middle;
}
.tot-main .tot-open-tab:hover { background: var(--tot-primary-soft); }
.tot-main .tot-title h1 { margin: 0 0 4px; font-size: 26px; line-height: 1.35; letter-spacing: 0; }
.tot-main .tot-lead { margin: 0 0 12px; color: var(--tot-muted); }

.tot-main .tot-privacy {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 20px;
  padding: 10px 14px;
  border-radius: var(--tot-radius);
  background: var(--tot-success-soft);
  color: var(--tot-success-text);
  font-size: 14px;
}

.tot-doc { margin-top: 36px; }
.tot-main .tot-doc h2 {
  font-size: 20px;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--tot-border);
}

/* ── ボタン ── */
.tot-btn {
  appearance: none;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--tot-primary);
  border-radius: var(--tot-radius);
  background: transparent;
  color: var(--tot-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tot-btn:hover { background: var(--tot-primary-soft); }
.tot-btn-primary { background: var(--tot-primary); color: var(--tot-on-primary); }
.tot-btn-primary:hover { background: var(--tot-primary-hover); }
.tot-btn-quiet { border-color: var(--tot-border); color: var(--tot-muted); }
.tot-btn-quiet:hover { background: var(--tot-surface); }

@media (min-width: 900px) {
  .tot-main { padding: 24px 24px 80px; }
  .tot-main .tot-title h1 { font-size: 30px; }
}

/* 利用状況の計測の設定（src/shared/usage/usage-page.js。画面の下に出し、ツールの操作を妨げない。閉じられる） */
.tot-usage-note { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; max-width: 720px; max-height: 70vh; overflow: auto; margin: 0 auto; padding: 12px 14px; border: 1px solid var(--tot-border); border-radius: var(--tot-radius); background: var(--tot-field-bg); color: var(--tot-text); font-size: 13px; line-height: 1.6; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); }
.tot-usage-note p { margin: 0 0 6px; }
.tot-usage-title { font-weight: 700; font-size: 14px; }
.tot-usage-state { color: var(--tot-muted); }
.tot-usage-note a { color: var(--tot-primary); }
.tot-usage-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
/* 「許可する」「許可しない」は同じ見た目（どちらかを目立たせない） */
.tot-usage-btn { min-height: 36px; padding: 4px 16px; border: 1px solid var(--tot-input-border); border-radius: 6px; background: var(--tot-surface); color: var(--tot-text); font: inherit; font-weight: 600; cursor: pointer; }
.tot-usage-btn:focus-visible, .tot-usage-note-close:focus-visible { outline: 3px solid var(--tot-focus); outline-offset: 2px; }
.tot-usage-note-close { margin-left: auto; padding: 2px 10px; border: 1px solid var(--tot-input-border); border-radius: 6px; background: transparent; color: var(--tot-text); font: inherit; cursor: pointer; }

/* TOT-038 商品説明のタグ外し。CSV を開く → 一覧 → 見比べ → 使う → 別名で保存 */
.tot-dtxt { max-width: 1200px; }
.tot-dtxt-device { margin: 0 0 12px; padding: 8px 12px; border-left: 4px solid var(--tot-primary); background: var(--tot-primary-soft); border-radius: var(--tot-radius); font-size: 14px; }
.tot-dtxt-step { margin: 0 0 18px; }
.tot-dtxt-step > h3 { margin: 0 0 8px; font-size: 16px; }
.tot-dtxt-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px; border: 2px dashed var(--tot-border); border-radius: var(--tot-radius); background: var(--tot-surface); }
.tot-dtxt-drop.is-dragover { border-color: var(--tot-primary); background: var(--tot-primary-soft); }
.tot-dtxt-drop-note { font-size: 13px; color: var(--tot-muted); }
.tot-dtxt-fileinfo, .tot-dtxt-msg { margin: 8px 0 0; font-size: 14px; min-height: 1.2em; }
.tot-dtxt .is-ok { color: var(--tot-success-text); }
.tot-dtxt .is-error { color: var(--tot-danger); }
.tot-dtxt-warn { margin: 6px 0 0; padding-left: 1.4em; font-size: 13px; color: var(--tot-danger); }
.tot-dtxt-warn:empty { display: none; }
.tot-dtxt-cols { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--tot-border); border-radius: var(--tot-radius); }
.tot-dtxt-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: 0; }
.tot-dtxt-select, .tot-dtxt-search, .tot-dtxt-name { min-height: 36px; padding: 4px 8px; font-size: 14px; border: 1px solid var(--tot-input-border); border-radius: var(--tot-radius); background: var(--tot-field-bg); color: var(--tot-text); max-width: 100%; }
.tot-dtxt-name { width: min(100%, 460px); }
.tot-dtxt-colnote { flex-basis: 100%; margin: 0; font-size: 13px; }
.tot-dtxt-colnote.is-error { color: var(--tot-danger); }
.tot-dtxt-search { width: min(100%, 360px); }
.tot-dtxt-listinfo { margin: 6px 0; font-size: 13px; color: var(--tot-muted); }
.tot-dtxt-listwrap { max-height: 360px; overflow: auto; border: 1px solid var(--tot-border); border-radius: var(--tot-radius); }
.tot-dtxt-list { width: 100%; border-collapse: collapse; font-size: 13px; }
.tot-dtxt-list th, .tot-dtxt-list td { padding: 6px 8px; border-bottom: 1px solid var(--tot-border); text-align: left; vertical-align: top; }
.tot-dtxt-list thead th { position: sticky; top: 0; background: var(--tot-surface); }
.tot-dtxt-list tr.is-selected td { background: var(--tot-primary-soft); }
.tot-dtxt-title { overflow-wrap: anywhere; }
.tot-dtxt-pick { padding: 2px 6px; border: 1px solid var(--tot-input-border); border-radius: 6px; background: var(--tot-field-bg); color: var(--tot-primary); font: inherit; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.tot-dtxt-pick[aria-current="true"] { background: var(--tot-primary); color: var(--tot-on-primary); }
.tot-dtxt-target { margin: 0 0 8px; font-weight: 700; overflow-wrap: anywhere; }
.tot-dtxt-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.tot-dtxt-pane { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13px; font-weight: 700; }
.tot-dtxt-meta { font-weight: 400; color: var(--tot-muted); }
.tot-dtxt-area { width: 100%; min-height: 320px; padding: 8px; resize: vertical; font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--tot-input-border); border-radius: var(--tot-radius); background: var(--tot-field-bg); color: var(--tot-text); box-sizing: border-box; }
.tot-dtxt-report { margin-top: 10px; font-size: 13px; }
.tot-dtxt-report > * { margin: 6px 0; }
.tot-dtxt-detail summary { cursor: pointer; }
.tot-dtxt-detail ul { margin: 4px 0; padding-left: 1.4em; overflow-wrap: anywhere; }
.tot-dtxt-sample { white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace; }
.tot-dtxt-alert, .tot-dtxt-broken { padding: 6px 10px; border-left: 4px solid var(--tot-danger); background: var(--tot-danger-soft); border-radius: var(--tot-radius); }
.tot-dtxt-broken p { margin: 0; font-weight: 700; }
.tot-dtxt-broken ul { margin: 4px 0 0; padding-left: 1.4em; overflow-wrap: anywhere; }
.tot-dtxt-ok { color: var(--tot-success-text); }
.tot-dtxt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tot-dtxt-handoff { margin-top: 8px; padding: 8px 12px; border: 1px solid var(--tot-border); border-radius: var(--tot-radius); background: var(--tot-surface); font-size: 14px; }
.tot-dtxt-handoff a { overflow-wrap: anywhere; }
.tot-dtxt-note { font-size: 13px; color: var(--tot-muted); }
.tot-dtxt-summary { font-size: 14px; }
.tot-dtxt-help h3 { font-size: 15px; }
