/* ============================================================
   site.css — akikan.win のサイト共通デザイン（/tool/<ID>/ のツールの画面は使わない。ツール一覧 /tool/ は使う）
   2026-10-26 案件018 で作成（Webサイト担当）。
   ホーム（/）と、投稿（/posts/…。案件019）、プロフィール（/profile/。案件021）、管理者ページ、
   入口の画面（ツール一覧・ログイン・アカウント・403・404。案件038）で読み込む。
   ・色とフォントは下の CSS 変数で使う（変数名は docs/web/引継ぎメモ_Webサイト_共通.md の14章）。
   ・ライト／ダークは <html data-theme="light|dark">。属性が無いときは OS の設定に合わせる。
     切り替えボタンと選択の記憶は /site.js。
   ============================================================ */

/* ---- ライト（既定） ---- */
:root {
  --bg: #F7F5F0;            /* 背景 */
  --surface: #FFFFFF;       /* 面（カード等） */
  --surface-soft: #ECE8DF;  /* 薄い面 */
  --text: #1F1E1C;          /* 文字 */
  --text-muted: #5E5B55;    /* 補助の文字 */
  --line: #E3DFD6;          /* 線 */
  --accent: #8A6A2B;        /* アクセント */
  /* 記事の文字色（案件019。記事には色の名前だけを保存し、色はここで決める。企画書 4-6） */
  --tc-accent: #8A6A2B;
  --tc-red: #B3412E;
  --tc-blue: #2F5FAE;

  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-display: "Oswald", "Zen Kaku Gothic New", sans-serif;
  --content-max: 1040px;    /* 本文の最大幅 */
  --gutter: 20px;           /* 左右の余白 */
  --tap: 44px;              /* ボタン等の最小の大きさ */

  color-scheme: light;
}

/* ---- ダーク: OS がダークで、ボタンで「ライト」を選んでいないとき ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161616;
    --surface: #1F1F1E;
    --surface-soft: #2A2927;
    --text: #ECE8E1;
    --text-muted: #A39E93;
    --line: #33312D;
    --accent: #D2AE66;
    --tc-accent: #D2AE66;
    --tc-red: #E07A66;
    --tc-blue: #7FA6E0;
    color-scheme: dark;
  }
}
/* ---- ダーク: ボタンで「ダーク」を選んだとき ---- */
:root[data-theme="dark"] {
  --bg: #161616;
  --surface: #1F1F1E;
  --surface-soft: #2A2927;
  --text: #ECE8E1;
  --text-muted: #A39E93;
  --line: #33312D;
  --accent: #D2AE66;
  --tc-accent: #D2AE66;
  --tc-red: #E07A66;
  --tc-blue: #7FA6E0;
  color-scheme: dark;
}

/* ---- 土台 ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.75; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- ページの枠（ヘッダー・本文・フッター） ---- */
.site-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.site-wrap {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* ヘッダー */
.site-header {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 8px 16px; padding: 20px 0; border-bottom: 1px solid var(--line);
}
.site-logo {
  font-family: var(--font-display); font-weight: 600; font-size: 24px; letter-spacing: 0.04em;
  min-height: var(--tap); display: flex; align-items: center; line-height: 1;
}
.site-logo span { color: var(--accent); }
.site-header-right { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px; font-size: 14px; }
.site-nav a { padding: 10px 12px; min-height: var(--tap); display: flex; align-items: center; }
.site-nav a[aria-current="page"] {
  color: var(--accent); font-weight: 700;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px;
}

/* 右上の小さなログインの欄（2026-10-27 ユーザーの希望。メニューとは並べず、目立たないように）
   ログインしていない: 「ログイン」／ログイン中: ユーザーID・「管理者」（サイト管理者だけ）・「ログアウト」。中身は site.js が入れる */
.site-account {
  position: absolute; top: 0; right: 0;
  display: flex; align-items: center; gap: 2px;
  font-size: 11px; line-height: 1.4; letter-spacing: 0.04em; color: var(--text-muted);
}
.site-account a, .site-account button, .site-account .who {
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
  padding: 2px 4px; opacity: 0.8;
}
.site-account .who { cursor: default; opacity: 1; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-account a:hover, .site-account button:hover { opacity: 1; color: var(--accent); }
.site-account > * + *::before { content: "·"; margin-right: 6px; opacity: 0.6; }

/* ライト／ダークの切り替えボタン（中のアイコンは今の見た目で出し分け） */
.theme-toggle {
  width: var(--tap); height: var(--tap); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--text); cursor: pointer; padding: 0;
}
.theme-toggle .icon-sun { display: none; }   /* ダークのとき「ライトへ」＝太陽 */
.theme-toggle .icon-moon { display: block; } /* ライトのとき「ダークへ」＝月 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* 本文 */
.site-main { flex-grow: 1; }

/* フッター */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 12px; padding: 28px 0 44px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-muted);
}
.site-footer-logo { font-family: var(--font-display); letter-spacing: 0.04em; font-size: 16px; color: var(--text); }

/* ---- ホーム（工事中） ---- */
.home-construction {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 120px 0;
}
.home-construction .eyebrow {
  margin: 0; font-family: var(--font-display); font-weight: 500;
  letter-spacing: 0.16em; font-size: 13px; color: var(--accent);
}
.home-construction h1 { margin: 8px 0 0; font-size: clamp(28px, 4vw, 36px); font-weight: 700; line-height: 1.5; }

/* ============================================================
   投稿（/posts/…。案件019）。ページはサーバーが作る（editor/pages.py）
   ============================================================ */
.eyebrow {
  margin: 0; font-family: var(--font-display); font-weight: 500;
  letter-spacing: 0.16em; font-size: 13px; color: var(--accent);
}

/* パンくず */
.breadcrumb ol { list-style: none; margin: 0; padding: 16px 0 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--text-muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; }
.breadcrumb a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.breadcrumb [aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 20em; }

/* 一覧 */
.posts-page { padding-bottom: 48px; }
.posts-head { padding: 40px 0 24px; }
.posts-head h1 { margin: 4px 0 0; font-size: clamp(26px, 4vw, 32px); line-height: 1.4; }
.posts-empty { color: var(--text-muted); padding: 40px 0; }
.post-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.post-card {
  display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.post-card:hover { opacity: 1; border-color: var(--accent); }
.post-card-img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; border-radius: 6px; background: var(--surface-soft); display: block; }
.post-card-noimg {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.04em; color: var(--text-muted); font-size: 14px;
}
.post-card-noimg span { color: var(--accent); }
.post-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.post-card-meta { font-size: 12px; color: var(--text-muted); }
.post-card-title { font-size: 18px; font-weight: 700; line-height: 1.5; }
.post-card-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 28px 0 0; font-size: 14px; }
.pager a { min-height: var(--tap); display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; }
.pager-now { color: var(--text-muted); }

/* 記事 */
.post-page { padding-bottom: 56px; }
.post-article { max-width: 720px; margin: 0 auto; }
.post-header { padding: 32px 0 20px; }
.post-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-muted); }
.post-cat { color: var(--accent); font-weight: 700; }
.post-title { margin: 8px 0 0; font-size: clamp(24px, 4vw, 32px); line-height: 1.45; font-weight: 700; }
.post-eyecatch { margin: 0 0 28px; }
.post-eyecatch img { width: 100%; height: auto; border-radius: 10px; display: block; }
.post-back { max-width: 720px; margin: 40px auto 0; font-size: 14px; }
.post-back a { color: var(--accent); }

.post-body { font-size: 16px; line-height: 1.9; }
.post-body > * { margin: 0 0 1.4em; }
.post-body h2, .post-body h3, .post-body h4 { line-height: 1.5; margin: 2.2em 0 0.8em; scroll-margin-top: 16px; }
.post-body h2 { font-size: 22px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.post-body h3 { font-size: 19px; padding-left: 12px; border-left: 4px solid var(--accent); }
.post-body h4 { font-size: 17px; }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-body b { font-weight: 700; }
.post-body mark { background: color-mix(in srgb, var(--accent) 25%, transparent); color: inherit; padding: 0 2px; }
.post-body ul, .post-body ol { padding-left: 1.6em; }
.post-body li + li, .post-body li > ul, .post-body li > ol { margin-top: 0.3em; }
.post-body li > ul, .post-body li > ol { margin-bottom: 0; }
.post-body ul.checklist { list-style: none; padding-left: 0.2em; }
.post-body ul.checklist ul.checklist { padding-left: 1.6em; }
.post-body .check { display: inline-block; width: 1em; height: 1em; margin-right: 0.5em; vertical-align: -0.12em;
  border: 2px solid var(--text-muted); border-radius: 3px; }
.post-body .check.checked { background: var(--accent); border-color: var(--accent); }
.post-body blockquote { margin-left: 0; margin-right: 0; padding: 12px 18px; border-left: 4px solid var(--line);
  background: var(--surface-soft); border-radius: 0 8px 8px 0; }
.post-body blockquote p { margin: 0; }
.post-body blockquote cite { display: block; margin-top: 6px; font-size: 13px; font-style: normal; color: var(--text-muted); }
.post-body blockquote cite::before { content: "— "; }
.post-body .inline-code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.9em;
  background: var(--surface-soft); padding: 0.1em 0.35em; border-radius: 4px; }
.post-body .code-block { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 14px; line-height: 1.6;
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px;
  overflow-x: auto; white-space: pre; overflow-wrap: normal; -webkit-overflow-scrolling: touch; }
.post-body .delimiter { border: 0; text-align: center; height: auto; margin: 2em 0; }
.post-body .delimiter::before { content: "＊ ＊ ＊"; color: var(--text-muted); letter-spacing: 0.4em; }
.post-body .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.post-body table { border-collapse: collapse; min-width: 100%; font-size: 14px; line-height: 1.6; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.post-body th { background: var(--surface-soft); font-weight: 700; }
.post-body figure { margin-left: 0; margin-right: 0; }
.post-body .post-image img { max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 8px; }
.post-body figcaption { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 6px; }

/* 画像の設定（Editor.js の Image: 枠線・背景・横幅いっぱい） */
.post-body .post-image.img-border img { border: 1px solid var(--line); }
.post-body .post-image.img-bg { background: var(--surface-soft); padding: 16px; border-radius: 10px; }
.post-body .post-image.img-bg img { max-width: 70%; }
.post-body .post-image.img-stretched img { width: 100%; }
.post-body .quote-center { text-align: center; border-left: 0; border-radius: 8px; }

/* 注意書き（Editor.js の Warning） */
.post-warning { border: 1px solid var(--tc-red); border-left-width: 4px; border-radius: 8px; padding: 12px 16px; background: var(--surface); }
.post-warning p { margin: 0; }
.post-warning p + p { margin-top: 4px; }
.post-warning-title { font-weight: 700; color: var(--tc-red); }

/* ブロックの設定（Editor.js の Text Variant: 強調の枠・引用風・補足） */
.post-body .tv-call-out { border: 1px solid var(--accent); border-radius: 10px; padding: 12px 18px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.post-body .tv-call-out > :last-child, .post-body .tv-citation > :last-child, .post-body .tv-details > :last-child { margin-bottom: 0; }
.post-body .tv-citation { font-style: italic; color: var(--text-muted); }
.post-body .tv-details { font-size: 0.86em; color: var(--text-muted); }

/* 文字色（色の名前 → ライト／ダークの色。:root の --tc-*） */
.tc-accent { color: var(--tc-accent); }
.tc-red { color: var(--tc-red); }
.tc-blue { color: var(--tc-blue); }

/* 目次 */
.post-toc { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; }
.post-toc-title { margin: 0 0 6px; font-weight: 700; font-size: 14px; }
.post-toc ol { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 1.7; }
.post-toc li { margin: 0; }
.post-toc a { color: inherit; text-decoration: none; display: block; padding: 3px 0; }
.post-toc a:hover { color: var(--accent); opacity: 1; }
.post-toc .toc-l3 { padding-left: 1.2em; }
.post-toc .toc-l4 { padding-left: 2.4em; font-size: 13px; }

/* 埋め込み */
.embed iframe { display: block; width: 100%; border: 0; }
.embed-video iframe { aspect-ratio: 16 / 9; height: auto; border-radius: 8px; }
.embed-map iframe { height: 360px; border-radius: 8px; }
.embed-spotify iframe { border-radius: 12px; }
.embed-x .twitter-tweet { margin: 0 auto !important; }
.embed-x blockquote.twitter-tweet { border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; background: var(--surface); }
.link-card { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--surface); text-decoration: none !important; color: inherit !important; }
.link-card:hover { opacity: 1; border-color: var(--accent); }
.link-card-img { width: 30%; max-width: 220px; aspect-ratio: 1.91 / 1; object-fit: cover; flex: 0 0 auto; background: var(--surface-soft); }
.link-card-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; min-width: 0; justify-content: center; }
.link-card-title { font-weight: 700; line-height: 1.5; font-size: 15px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-card-site { font-size: 12px; color: var(--text-muted); }

/* ---- プロフィール（/profile/。2026-10-30 案件021。デザイン案「テイスト案 v2」のプロフィール） ---- */
.profile-page { padding-bottom: 80px; }
.profile-hero { padding: 64px 0 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 28px 36px; }
.profile-icon {
  flex: 0 0 auto; width: 132px; height: 132px; border-radius: 50%; object-fit: cover; display: block;
  background: var(--surface-soft); border: 3px solid var(--surface); outline: 1px solid var(--line);
}
.profile-icon-none { display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 48px; color: var(--text-muted); }
.profile-hero-text { flex: 1 1 320px; min-width: 0; }
.profile-hero-text .eyebrow { margin: 0; }
.profile-name { margin: 2px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 44px;
  letter-spacing: 0.04em; line-height: 1.2; overflow-wrap: anywhere; }
.profile-cols { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.profile-main { flex: 999 1 520px; min-width: 0; }
.profile-side { flex: 1 1 320px; min-width: 0; }
.profile-h2 { margin: 0 0 16px; font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 12px; line-height: 1.5; }
.profile-h2 span { width: 18px; height: 3px; background: var(--accent); border-radius: 2px; flex: 0 0 auto; }
.profile-body > :last-child { margin-bottom: 0; }
.profile-empty { color: var(--text-muted); }

/* 外部リンクのボタン: 色はボタンごとの CSS 変数（profile_page/colors.py の link_style が付ける）
   --lk-c 指定した色 / --lk-c1・--lk-c2 少し透けた色 / --lk-fg-l・--lk-fg-d ライト・ダークでの文字色 */
.profile-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.profile-link {
  display: flex; align-items: center; min-height: 80px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); color: var(--lk-fg-l, #FFFFFF);
  background: linear-gradient(90deg, var(--lk-c) 0, var(--lk-c) 84px, var(--lk-c1) 45%, var(--lk-c2) 100%), var(--surface);
}
.profile-link:hover { opacity: 0.85; }
.profile-link-icon { flex: 0 0 84px; align-self: stretch; display: flex; align-items: center; justify-content: center; }
.profile-link-icon img { width: 60px; height: 60px; display: block; object-fit: contain; }
.profile-link-noicon { font-family: var(--font-display); font-weight: 600; font-size: 26px; opacity: 0.85; }
.profile-link-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; padding: 14px 12px 14px 24px; line-height: 1.5; }
.profile-link-title { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.profile-link-desc { font-size: 13px; opacity: 0.9; overflow-wrap: anywhere; }
.profile-link-arrow { flex: 0 0 auto; margin-right: 20px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .profile-link { color: var(--lk-fg-d, #FFFFFF); }
}
:root[data-theme="dark"] .profile-link { color: var(--lk-fg-d, #FFFFFF); }

/* 連絡先（メールは /profile/profile.js が組み立てて表示する） */
.profile-contact { margin-top: 40px; }
.profile-side > .profile-contact:first-child { margin-top: 0; }   /* 外部リンクが1つも無いとき */
.profile-mail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.profile-mail-addr { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.profile-mail-addr a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.profile-mail-copy { font: inherit; font-size: 13px; font-weight: 700; min-height: var(--tap); padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.profile-mail-copy:hover { border-color: var(--accent); }
.profile-mail-done { font-size: 12px; color: var(--text-muted); }
.profile-mail-done:empty { display: none; }

/* 管理画面のプレビューの帯 */
.preview-banner { position: sticky; top: 0; z-index: 10; background: var(--accent); color: var(--bg);
  text-align: center; font-size: 13px; font-weight: 700; padding: 8px 12px; }

/* ============================================================
   入口の画面（2026-11-17 案件038）: ツール一覧 /tool/・ログイン /login・アカウント /account/・403・404
   ・ツール一覧は公開。ログイン・アカウント・403・404 は noindex。☰メニュー（userbar.js）は読み込まない。
   ・ログイン画面は 8081（noVNC の中の Chromium。Google Fonts が開けない）でも使う。
     そこでは /api/whoami が 404 になるので、ログイン画面のスクリプトが <html> に .is-ext を付け、
     8081 では開けないヘッダーのメニューを隠す。
   ============================================================ */
:root { --ok: #2F7A57; --ng: #B3412E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ok: #7CC3A0; --ng: #E07A66; } }
:root[data-theme="dark"] { --ok: #7CC3A0; --ng: #E07A66; }

.entry-main { padding: 40px 0 64px; display: flex; flex-direction: column; gap: 24px; }
.entry-narrow { width: 100%; max-width: 440px; margin: 0 auto; }
.entry-head h1 { margin: 4px 0 0; font-size: clamp(26px, 4vw, 32px); line-height: 1.4; }
.entry-lead { margin: 8px 0 0; color: var(--text-muted); font-size: 15px; line-height: 1.8; }
.entry-note { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.8; }
.entry-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; min-width: 0; }
.entry-panel > h2 { margin: 0 0 12px; font-size: 16px; }
.entry-panel > :last-child { margin-bottom: 0; }

/* 入力欄・ボタン（入口の画面だけ。.entry-form の中） */
.entry-form label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 6px; }
.entry-form input {
  display: block; width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: var(--tap); margin: 0 0 16px;
}
.entry-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.entry-btn {
  font: inherit; font-size: 15px; font-weight: 700; min-height: var(--tap); padding: 0 20px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--bg);
}
.entry-btn:hover { opacity: .85; }
.entry-btn.wide { width: 100%; }
.entry-btn.sub { background: transparent; color: var(--text); border-color: var(--line); }
.entry-btn.sub:hover { border-color: var(--accent); opacity: 1; }
.entry-btn.danger { background: transparent; color: var(--ng); border-color: color-mix(in srgb, var(--ng) 45%, transparent); }
.entry-btn:disabled { opacity: .45; cursor: default; }
.entry-row { display: flex; gap: 10px; flex-wrap: wrap; }
.entry-msg { margin: 0 0 12px; font-size: 13px; font-weight: 700; min-height: 1.4em; }
.entry-msg.err { color: var(--ng); }
.entry-msg.ok { color: var(--ok); }
.entry-notice { margin: 0; padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 700; line-height: 1.7;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.entry-who { font-size: 15px; line-height: 1.8; }
.entry-who b { font-size: 18px; margin-right: .6em; }
.entry-who .tools { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
[hidden] { display: none !important; }

/* 403・404 */
.entry-message { align-items: flex-start; padding: 72px 0 96px; }
.entry-message h1 { margin: 4px 0 0; font-size: clamp(26px, 4vw, 32px); line-height: 1.4; }
.entry-message p { margin: 0; }
.entry-links { display: flex; flex-wrap: wrap; gap: 8px; }
.entry-links a { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.entry-links a:hover { opacity: 1; border-color: var(--accent); }

/* ツール一覧のカード。--tool はツールの色（tool/<ID>/ の画面の --primary と同じ。共通メモ12-1） */
.tool-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tool-cards [data-need]:not(.is-ok) { display: none; }      /* 権限がある人にだけ出すカード（ツール一覧のスクリプトが .is-ok を付ける） */
.tool-card {
  position: relative; height: 100%; display: flex; flex-direction: column; gap: 6px; padding: 20px 20px 20px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.tool-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tool, var(--accent)); }
.tool-card:hover { opacity: 1; border-color: var(--accent); }
.tool-card .en { font-family: var(--font-display); font-weight: 500; letter-spacing: .14em; font-size: 12px; color: var(--accent); }
.tool-card .ja { font-size: 19px; font-weight: 700; line-height: 1.5; }
.tool-card .desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.tool-card .tag { align-self: flex-start; margin-top: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-soft); color: var(--text-muted); }

/* 8081（拡張機能用ポート）では開けないヘッダーのメニュー・ロゴのリンクを隠す（ログイン画面だけ） */
.is-ext .site-nav { display: none; }
.is-ext .site-logo { pointer-events: none; }

/* ---- スマホ幅 ---- */
@media (max-width: 480px) {
  .entry-main { padding: 28px 0 48px; }
  .entry-message { padding: 48px 0 64px; }
  .home-construction { padding: 80px 0; }
  .site-nav a { padding: 10px 9px; }
  .post-card { grid-template-columns: 96px 1fr; gap: 12px; }
  .post-card-desc { display: none; }
  .post-title { font-size: 24px; }
  .profile-hero { padding: 40px 0 32px; gap: 20px 24px; }
  .profile-icon { width: 104px; height: 104px; }
  .profile-name { font-size: 36px; }
  .profile-cols { gap: 40px; }
}
