/* TECMEX Junction — 共通スタイル（デザイントークンは :root にまとめる）
   色は一般財団法人 首都高速道路技術センター（TECMEX）のコーポレートカラーに合わせる */
:root {
  /* TECMEX のブランド色 */
  --brand: #1a4a98;            /* コーポレートブルー（主色） */
  --brand-hover: #153c7c;
  --brand-ink: #173a73;        /* 見出しなどの濃い青の文字 */
  --brand-mid: #1f75b7;        /* 中間の青（リンク・補助ボタン） */
  --brand-mid-hover: #1a64a0;
  --brand-sky: #2789ba;        /* スカイブルー（アイコン・線画） */
  --brand-pale: #e8eff9;       /* 淡い青（選択中・強調だけに使う） */
  --brand-pale-2: #f3f6fb;     /* ごく淡い青（ホバー） */
  --brand-line: #c6e0e7;       /* 淡い青の境界線 */
  --brand-line-2: #a4c2ca;
  --brand-yellow: #fcc800;     /* 差し色（新着・印） */
  --brand-yellow-ink: #4a3b00;
  /* 互換用の名前（既存のクラスが参照する） */
  --navy-950: #12233a;
  --navy-900: #143a78;
  --navy-800: var(--brand);
  --navy-700: #1f5aa8;
  --navy-600: #3f6fb2;
  --navy-300: #9db3cf;
  --navy-100: #dfe3e8;
  --navy-50: #f1f3f5;
  --teal-700: #17619b;
  --teal-600: var(--brand-mid);
  --teal-500: var(--brand-sky);
  --teal-100: #d5e2f3;
  --teal-50: var(--brand-pale);
  /* 色：文字・面・線 */
  --ink: #1f2933;              /* 本文 */
  --ink-2: #3e4954;
  --muted: #5b6675;            /* 補足（白地で 5.9:1） */
  --faint: #6b7480;            /* 薄い補足（白地で 4.7:1。指定の #7B8591 は 3.8:1 のため少し濃く） */
  --bg: #f4f5f7;               /* ページの地（ニュートラルなグレー） */
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --soft: #f1f3f5;             /* 薄いグレーの面（タイル・セグメント） */
  --line: #e3e6ea;
  --line-strong: #cdd2d8;
  /* 色：状態 */
  --ok: #1d7f55;
  --ok-soft: #e7f4ed;
  --ok-line: #b5dcc6;
  --warn: #94600a;
  --warn-soft: #fcf4e4;
  --warn-line: #efd29b;
  --danger: #c0392b;
  --danger-hover: #a52f23;
  --danger-soft: #fcecea;
  --danger-line: #f1bdb6;
  --info: var(--navy-700);
  --info-soft: var(--navy-50);
  /* カードの色帯（accent）。teal は画面では「空色」 */
  --ac-blue: #1a4a98;   --ac-blue-soft: #eaf1fa;
  --ac-teal: #1f7fae;   --ac-teal-soft: #e8f4f9;
  --ac-green: #2f8a4f;  --ac-green-soft: #e9f5ec;
  --ac-amber: #94600a;  --ac-amber-soft: #fbf3e2;
  --ac-rose: #b8436a;   --ac-rose-soft: #fbedf2;
  --ac-slate: #56657c;  --ac-slate-soft: #eef2f6;
  /* 主要な役割 */
  --primary: var(--brand);
  --primary-hover: var(--brand-hover);
  --primary-soft: var(--brand-pale);
  --accent: var(--brand-mid);
  --accent-hover: var(--brand-mid-hover);
  --accent-soft: var(--brand-pale);
  --focus: 0 0 0 2px #fff, 0 0 0 4px var(--brand-mid);
  /* 形 */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .05);
  --shadow-hover: 0 2px 6px rgba(16, 24, 40, .06), 0 14px 30px rgba(16, 24, 40, .10);
  --shadow-pop: 0 22px 56px rgba(18, 35, 58, .22);
  /* 余白 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
  /* 文字 */
  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  --font-num: "Inter", "Noto Sans JP", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, Menlo, "BIZ UDGothic", monospace;
  /* レイアウト */
  --side-w: 256px;
  --side-mini: 72px;
  --top-h: 56px;
  --content-w: 1240px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 14.5px; line-height: 1.7; letter-spacing: .01em;
  overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: var(--teal-700); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .5em; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.08rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
code, pre, .mono { font-family: var(--mono); }
code { font-size: .9em; background: var(--navy-50); padding: 1px 6px; border-radius: 4px; }
[hidden] { display: none !important; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.pre-line { white-space: pre-line; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.red { color: var(--danger); font-weight: 600; }
.ic { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 22px; height: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ====================== アプリの枠（サイドバー＋本文） ====================== */
.side {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--side-w);
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 60%, var(--brand-pale-2) 100%);
  border-right: 1px solid var(--line); color: var(--ink-2);
  display: flex; flex-direction: column; transition: width .2s ease, transform .25s ease;
}
.side-brand { display: block; padding: 22px 22px 18px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.side-brand:hover { text-decoration: none; }
.corp-logo { display: block; width: 100%; max-width: 212px; height: auto; }
.corp-mark { display: none; width: 40px; height: 40px; margin: 0 auto; }
.portal-name { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--brand-line); }
.pn-ic {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--brand); color: #fff; box-shadow: inset 0 -2px 0 var(--brand-yellow);
}
.pn-ic .ic { width: 19px; height: 19px; }
.pn-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.pn-text b { font-size: 1.04rem; font-weight: 700; color: var(--brand-ink); letter-spacing: .1em; white-space: nowrap; }
.pn-text small { font-size: .72rem; color: var(--muted); letter-spacing: .08em; white-space: nowrap; }
.side-nav { flex: 1; overflow-y: auto; padding: 14px 12px 12px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-label { font-size: .7rem; letter-spacing: .16em; color: var(--muted); padding: 0 12px 6px; white-space: nowrap; font-weight: 500; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: .93rem;
  white-space: nowrap; transition: background .15s, color .15s;
}
.nav-link .ic { width: 20px; height: 20px; color: #5f7896; }
.nav-link:hover { background: var(--brand-pale-2); color: var(--brand); text-decoration: none; }
.nav-link:hover .ic { color: var(--brand); }
.nav-link.active { background: var(--brand-pale); color: var(--brand); font-weight: 700; }
.nav-link.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-link.active .ic { color: var(--brand); }
.nav-count {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: var(--radius-pill);
  background: var(--brand); color: #fff; font: 600 .74rem/20px var(--font-num); text-align: center;
}
.side-foot { padding: 10px 12px 12px; border-top: 1px solid var(--line); position: relative; }
.user-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px;
  border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: left;
}
.user-btn:hover { background: var(--brand-pale); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: .9rem;
}
.user-meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.user-name { color: var(--ink); font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.user-btn .chev { margin-left: auto; color: var(--muted); }
.operator { padding: 8px 8px 0; font-size: .68rem; line-height: 1.55; color: var(--muted); letter-spacing: .02em; }
.side-toggle {
  display: flex; align-items: center; gap: 12px; margin: 0 12px 8px; padding: 8px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font: inherit; font-size: .82rem; cursor: pointer; white-space: nowrap;
}
.side-toggle:hover { background: var(--brand-pale-2); color: var(--brand); }
.side-toggle:focus-visible { outline: none; box-shadow: var(--focus); }
.side-toggle .ic { width: 18px; height: 18px; transition: transform .2s; }

.menu-pop {
  position: absolute; left: 12px; right: 12px; bottom: calc(100% - 4px); z-index: 50;
  background: #fff; color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-pop);
  border: 1px solid var(--line); padding: 6px; min-width: 200px;
}
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px;
  border: 0; background: none; font: inherit; font-size: .92rem; color: var(--ink); cursor: pointer; text-align: left;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--navy-50); text-decoration: none; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu-pop .ic { color: var(--muted); }

.main { margin-left: var(--side-w); min-height: 100vh; transition: margin-left .2s ease; }
.mtop { display: none; }
.view { max-width: var(--content-w); margin: 0 auto; padding: 32px 40px 72px; }

/* サイドバーを細くする（ワークスペースで使う）：T マークだけを出す */
.app.mini .side { width: var(--side-mini); }
.app.mini .main { margin-left: var(--side-mini); }
.app.mini .side-toggle span, .app.mini .nav-ext, .app.mini .corp-logo, .app.mini .portal-name, .app.mini .operator,
.app.mini .nav-label, .app.mini .nav-link > span:not(.nav-count),
.app.mini .user-meta, .app.mini .user-btn .chev { display: none; }
.app.mini .corp-mark { display: block; }
.app.mini .side-brand { padding: 16px 0; }
.app.mini .nav-link { justify-content: center; padding: 10px; }
.app.mini .nav-link.active::before { left: -12px; }
.app.mini .nav-count { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 16px; line-height: 16px; padding: 0 4px; font-size: .66rem; }
.app.mini .nav-group + .nav-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.app.mini .user-btn { justify-content: center; }
.app.mini .side-toggle .ic { transform: rotate(180deg); }
.app.mini .side-toggle { justify-content: center; margin: 0 12px 8px; }
.app.mini .menu-pop { left: 8px; right: auto; }

.scrim { position: fixed; inset: 0; background: rgba(18, 35, 58, .35); z-index: 35; }

/* ====================== ボタン ====================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; min-height: 40px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: .92rem; line-height: 1.2; letter-spacing: .02em;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: #b9c3d1; text-decoration: none; }
.btn:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, .star:focus-visible, .nav-link:focus-visible,
.tab:focus-visible, .seg button:focus-visible, .emoji-btn:focus-visible, .swatch:focus-visible, .mini-card:focus-visible,
.user-btn:focus-visible, .ws-tab-main:focus-visible, .ws-tab-x:focus-visible, .tool-btn:focus-visible, .side-brand:focus-visible,
.menu-pop a:focus-visible, .menu-pop button:focus-visible, .modal-x:focus-visible, .side-tabs a:focus-visible, .toc a:focus-visible,
a:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
.input:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(31, 117, 183, .22); }
.modal:focus { outline: none; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn .ic { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-danger-outline { color: var(--danger); border-color: var(--danger-line); }
.btn-danger-outline:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--navy-50); border-color: transparent; }
.btn-sm { padding: 5px 12px; min-height: 32px; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: 11px 22px; min-height: 48px; font-size: 1rem; }
.btn.copied { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none;
  border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); cursor: pointer; padding: 0;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--navy-50); color: var(--ink); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ====================== フォーム ====================== */
.field { display: block; margin-bottom: 16px; }
.field > span, .field-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .88rem; color: var(--ink-2); }
.field-label .opt, .field > span .opt { font-weight: 400; color: var(--faint); margin-left: 6px; font-size: .8rem; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 13px; min-height: 42px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 96px; line-height: 1.7; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--teal-500); outline: none; box-shadow: var(--focus); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.input.mono { font-family: var(--mono); font-size: .92rem; }
.input-count { display: flex; justify-content: flex-end; font-size: .76rem; color: var(--faint); margin-top: 4px; }
.input-count.over { color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.hint { font-size: .82rem; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row > .field { flex: 1 1 200px; }
.toggle {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none;
  font-weight: 600; padding: 4px 0; position: relative;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .sw { width: 40px; height: 24px; border-radius: 999px; background: #c8d0dc; position: relative; transition: background .2s; flex: none; }
.toggle .sw::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s;
}
.toggle input:checked + .sw { background: var(--accent); }
.toggle input:checked + .sw::after { transform: translateX(16px); }
.toggle input:focus-visible + .sw { box-shadow: var(--focus); }
.toggle input:disabled + .sw { opacity: .5; }
.search {
  position: relative; display: flex; align-items: center;
}
.search .ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; }
.search-lg .input { min-height: 50px; font-size: 1rem; border-radius: var(--radius); background: #fff; }
.search-lg .ic { left: 16px; width: 20px; height: 20px; }
.search .kbd {
  position: absolute; right: 12px; font: 500 .72rem/1 var(--font-num); color: var(--faint);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--surface-2);
}
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--navy-50); border-radius: 10px; flex: none; }
.seg button {
  border: 0; background: transparent; padding: 6px 14px; font: inherit; font-weight: 600; font-size: .86rem;
  color: var(--muted); cursor: pointer; border-radius: 8px; min-height: 32px; white-space: nowrap;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(19, 41, 75, .12); }

/* ====================== バッジ・チップ ====================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: .76rem; font-weight: 600; line-height: 1.7; white-space: nowrap;
  background: var(--navy-50); color: var(--ink-2);
}
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err { background: var(--danger-soft); color: var(--danger); }
.badge-stop { background: #eef0f3; color: #5b6574; }
.badge-draft { background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.badge-pub { background: var(--brand-pale); color: var(--brand); }
.badge-new { background: var(--brand-yellow); color: var(--brand-yellow-ink); font-weight: 700; letter-spacing: .06em; }
.badge-admin { background: var(--navy-800); color: #fff; }
.badge-creator { background: var(--teal-50); color: var(--teal-700); }
.badge-viewer { background: var(--navy-50); color: var(--ink-2); }
.badge-lock { background: var(--danger-soft); color: var(--danger); }
.badge-test-ok { background: var(--ok-soft); color: var(--ok); }
.badge-test-warn { background: var(--warn-soft); color: var(--warn); }
.badge-test-fail { background: var(--danger-soft); color: var(--danger); }
.badge-test-run { background: var(--navy-50); color: var(--navy-700); }
.badge-test-run::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
.badge-rt { background: var(--navy-50); color: var(--navy-700); margin-right: 6px; }
@keyframes pulse { 50% { opacity: .25; } }

.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font: inherit; font-size: .86rem; font-weight: 500; cursor: pointer; line-height: 1.4; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.chip .ic { width: 16px; height: 16px; color: var(--muted); }
span.chip { cursor: default; }
button.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(26, 74, 152, .18); }
.chip.on .ic { color: #fff; }
.chip-n { font: 500 .78rem/1 var(--font-num); opacity: .65; }
.chip-sm { padding: 2px 10px; font-size: .78rem; }

/* ====================== メッセージ ====================== */
.note {
  padding: 12px 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: .9rem; margin: 8px 0; color: var(--ink-2);
}
.note.info { background: var(--navy-50); border-color: var(--navy-100); color: var(--navy-800); }
.note.warn { background: var(--warn-soft); border-color: var(--warn-line); color: #7a4a06; }
.note.err { background: var(--danger-soft); border-color: var(--danger-line); color: #8f2a20; }
.note.ok { background: var(--ok-soft); border-color: var(--ok-line); color: #165c3d; }
.err-pre { max-height: 260px; overflow: auto; white-space: pre-wrap; margin: 0; font-family: var(--mono); font-size: .82rem; }
.loading { padding: 48px 0; text-align: center; color: var(--muted); }
.spinner {
  display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 8px;
  border: 2px solid var(--navy-100); border-top-color: var(--teal-500); border-radius: 50%; animation: spin .8s linear infinite;
}
.btn .spinner { margin-right: 0; border-color: rgba(255, 255, 255, .35); border-top-color: currentColor; }
.btn:not(.btn-primary):not(.btn-accent):not(.btn-danger) .spinner { border-color: var(--navy-100); border-top-color: var(--teal-500); }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, #eef1f5 0%, #f6f8fa 50%, #eef1f5 100%); background-size: 200% 100%; animation: skel 1.4s ease infinite; border-radius: 8px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

#toasts {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: #1d2a39; color: #fff; padding: 11px 18px; border-radius: 12px;
  box-shadow: var(--shadow-pop); font-weight: 500; font-size: .9rem; transition: opacity .3s, transform .3s;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-yellow); flex: none; }
.toast.err::before { background: #ff8a7a; }
.toast.hide { opacity: 0; transform: translateY(8px); }

/* ====================== 共通の部品 ====================== */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
}
.page-head h1 { margin: 0; }
.page-head .lead { margin: 6px 0 0; color: var(--muted); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; letter-spacing: .14em; color: var(--brand); font-weight: 600; margin-bottom: 6px; }
.eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--brand-yellow); }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; font-weight: 500; color: var(--muted); font-size: .9rem; }
.back:hover { color: var(--ink); text-decoration: none; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.panel > h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.panel-desc { color: var(--muted); font-size: .88rem; margin: -6px 0 16px; }
.panel-danger { border-color: var(--danger-line); }
.panel-warn { border-color: var(--warn-line); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.stack > * + * { margin-top: 20px; }
.stack > .panel { margin-bottom: 0; }
.section { margin-top: 36px; }
.quick { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 28px; }
.quick-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.quick .section { margin-top: 32px; min-width: 0; }
.quick .rail { display: flex; overflow-x: auto; gap: 12px; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.quick .rail .mini-card { flex: 0 0 236px; scroll-snap-align: start; }
@media (max-width: 1100px) { .quick-2 { grid-template-columns: minmax(0, 1fr); } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.section-head h2 .ic { color: var(--teal-600); }
.section-head .count { color: var(--muted); font-size: .86rem; }
.empty-state {
  text-align: center; padding: 56px 24px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.empty-state .empty-ic {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center;
  background: var(--navy-50); color: var(--navy-600);
}
.empty-state .empty-ic .ic { width: 26px; height: 26px; }
.empty-state h3 { color: var(--ink); margin-bottom: 6px; }
.empty-state.small { padding: 28px 16px; font-size: .9rem; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.logs {
  background: var(--navy-950); color: #dbe3ee; padding: 14px 16px; border-radius: 10px;
  max-height: 440px; overflow: auto; font-size: .8rem; line-height: 1.55; white-space: pre-wrap; margin: 12px 0 0;
}
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; overflow-wrap: break-word; word-break: normal; }
.tbl th, .tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { background: var(--surface-2); font-size: .78rem; color: var(--muted); font-weight: 600; white-space: nowrap; letter-spacing: .04em; }
.tbl tr:last-child td { border-bottom: none; }
.tbl td.actions { white-space: nowrap; text-align: right; }
.tbl td.actions .btn + .btn { margin-left: 6px; }
.tbl select.input { min-height: 34px; padding: 4px 10px; width: auto; font-size: .88rem; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 24px; overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; font: inherit; font-weight: 600;
  color: var(--muted); cursor: pointer; padding: 12px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; flex: none; font-size: .92rem;
}
.tab .ic { width: 17px; height: 17px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.on { color: var(--navy-800); border-bottom-color: var(--teal-500); }
.tab .badge { padding: 0 8px; font-size: .72rem; }

/* メーター・数値タイル */
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.stat-k { font-size: .8rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat-k .ic { color: var(--teal-600); width: 16px; height: 16px; }
.stat-v { font: 600 1.9rem/1.25 var(--font-num); letter-spacing: -.01em; margin-top: 6px; color: var(--ink); }
.stat-v small { font-size: .9rem; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat-v-sm { font-size: 1.15rem; padding-top: 6px; }
.stat-warn { border-color: var(--warn-line); }
.stat-warn .stat-v { color: var(--warn); }
.stat-alert { border-color: var(--danger-line); }
.stat-alert .stat-v { color: var(--danger); }
.meter { height: 8px; background: var(--navy-50); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.meter > div { height: 100%; background: var(--teal-500); border-radius: 999px; transition: width .4s; }
.meter > div.mid { background: #d99a1e; }
.meter > div.high { background: var(--danger); }
.meter-sub { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: 8px; }

/* ====================== お試しボックス（ホーム） ====================== */
.hero-band {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 18px; padding: 30px 36px 30px; margin-bottom: 20px;
  background: linear-gradient(112deg, #fdfeff 0%, #f1f8fb 42%, #e1eef7 100%);
  border: 1px solid #d3e5ee; box-shadow: 0 1px 2px rgba(26, 74, 152, .04);
}
.hero-band::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--brand) 0%, var(--brand-sky) 100%); }
.road-art { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--brand-sky); pointer-events: none; z-index: -1; }
.hero-band .search-lg .input { border-color: #cbdde8; box-shadow: 0 1px 2px rgba(26, 74, 152, .05), 0 10px 26px rgba(26, 74, 152, .08); }
.hero-band .search { max-width: 760px; }
.home-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.home-hero h1 { font-size: 1.72rem; margin: 0 0 6px; letter-spacing: .05em; color: var(--brand-ink); font-weight: 700; }
.home-hero p { margin: 0; color: var(--ink-2); }
.home-tools { display: flex; flex-direction: column; gap: 16px; }
.cat-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.cat-row::-webkit-scrollbar { display: none; }

.rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mini-card {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); min-width: 0; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.mini-card:hover { text-decoration: none; border-color: var(--brand-line); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.mini-card .mc-t { font-weight: 600; font-size: .88rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-card .mc-s { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-card.is-off { opacity: .6; }

.app-ic {
  width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--acs, var(--ac-teal-soft)); color: var(--ac, var(--ac-teal)); font-size: 21px; line-height: 1;
}
.app-ic .ic { width: 21px; height: 21px; }
.app-ic.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 30px; }
.app-ic.lg .ic { width: 28px; height: 28px; }
.app-ic.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 15px; }
.app-ic.sm .ic { width: 16px; height: 16px; }
.acc-blue { --ac: var(--ac-blue); --acs: var(--ac-blue-soft); }
.acc-teal { --ac: var(--ac-teal); --acs: var(--ac-teal-soft); }
.acc-green { --ac: var(--ac-green); --acs: var(--ac-green-soft); }
.acc-amber { --ac: var(--ac-amber); --acs: var(--ac-amber-soft); }
.acc-rose { --ac: var(--ac-rose); --acs: var(--ac-rose-soft); }
.acc-slate { --ac: var(--ac-slate); --acs: var(--ac-slate-soft); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 20px; }
.acard {
  position: relative; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.acard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--ac, var(--ac-teal)); z-index: 2; }
.acard:hover { border-color: var(--brand-line); box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.acard:focus-within { box-shadow: var(--focus); }
.acard-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.acard-link:focus { outline: none; }
.acard-thumb { position: relative; height: 164px; background: var(--acs, var(--ac-teal-soft)); overflow: hidden; border-bottom: 1px solid var(--line); }
.acard.no-thumb .acard-thumb { height: 72px; border-bottom-color: transparent; }
.acard-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; background: #fff; transition: transform .4s ease; }
.acard:hover .acard-thumb img { transform: scale(1.025); }
.thumb-ph { position: absolute; inset: 0; color: var(--ac, var(--ac-teal)); }
.thumb-ph .ph-ic { position: absolute; right: 18px; bottom: -14px; line-height: 1; opacity: .18; }
.thumb-ph .ph-ic .ic { width: 84px; height: 84px; stroke-width: 1.2; }
.acard:not(.no-thumb) .thumb-ph .ph-ic { right: 50%; bottom: 50%; transform: translate(50%, 50%); }
.thumb-ph::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(circle at 1px 1px, rgba(19, 41, 75, .09) 1px, transparent 0); background-size: 16px 16px;
}
.acard-flag { position: absolute; left: 12px; top: 14px; z-index: 2; display: flex; gap: 6px; }
.acard-flag .badge { box-shadow: 0 1px 2px rgba(0, 0, 0, .08); background: rgba(255, 255, 255, .95); }
.acard-flag .badge-err { color: var(--danger); }
.acard-body { padding: 16px 18px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.acard-head { display: flex; align-items: flex-start; gap: 12px; }
.acard-title { font-size: 1rem; font-weight: 700; margin: 0; line-height: 1.45; flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding-top: 6px; }
.acard-desc {
  color: var(--ink-2); font-size: .86rem; line-height: 1.7; margin: 0; min-height: 2.9em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.acard-desc.empty { color: var(--faint); }
.acard-meta { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: auto; padding-top: 6px; }
.acard-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.acard-cat { margin-left: auto; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.acard-cat .ic { width: 14px; height: 14px; }
.acard.is-off .acard-thumb > :not(.acard-flag) { filter: grayscale(.85); opacity: .5; }
.acard.is-off .acard-title, .acard.is-off .acard-desc { color: var(--muted); }
.acard.is-off .app-ic { filter: grayscale(.8); opacity: .7; }
.acard.is-off .acard-link { cursor: not-allowed; }
.acard.is-off:hover { transform: none; }
.star {
  position: relative; z-index: 3; flex: none; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--faint); cursor: pointer; transition: color .15s, background .15s, transform .1s;
}
.star:hover { background: var(--navy-50); color: var(--warn); }
.star:active { transform: scale(.9); }
.star.on { color: #9a7600; }
.star.on .ic { fill: var(--brand-yellow); }
.star .ic { width: 19px; height: 19px; }

/* ====================== ワークスペース ====================== */
.ws { display: flex; flex-direction: column; height: 100vh; height: 100dvh; background: var(--navy-50); }
.ws-bar { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px 0; background: var(--navy-50); border-bottom: 1px solid var(--line); min-height: 52px; }
.ws-tabs { display: flex; align-items: flex-end; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tab {
  position: relative; display: flex; align-items: center; gap: 4px; min-width: 120px; max-width: 220px; flex: 0 1 220px;
  padding: 0 4px 0 6px; height: 40px; border-radius: 10px 10px 0 0; color: var(--ink-2);
  transition: background .15s;
}
.ws-tab:hover { background: rgba(255, 255, 255, .6); }
.ws-tab.on { background: #fff; color: var(--ink); box-shadow: 0 -1px 0 var(--line), 1px 0 0 var(--line), -1px 0 0 var(--line); }
.ws-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: #fff; }
.ws-tab:not(.on) + .ws-tab:not(.on)::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 1px; background: var(--line-strong); }
.ws-tab-main {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 100%; border: 0; background: none;
  font: inherit; font-size: .86rem; font-weight: 600; color: inherit; cursor: pointer; padding: 0 4px; text-align: left;
}
.ws-tab-main .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-tab-x { width: 24px; height: 24px; border-radius: 6px; border: 0; background: none; display: grid; place-items: center; color: var(--muted); cursor: pointer; flex: none; padding: 0; }
.ws-tab-x:hover { background: var(--navy-50); color: var(--ink); }
.ws-tab-x .ic { width: 14px; height: 14px; }
.ws-tab .app-ic.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 13px; }
.ws-tab .app-ic.sm .ic { width: 13px; height: 13px; }
.ws-add { align-self: center; margin-left: 4px; width: 32px; height: 32px; }
.ws-tools { display: flex; align-items: center; gap: 2px; padding-bottom: 6px; flex: none; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.tool-btn:hover { background: #fff; color: var(--ink); }
.tool-btn[aria-pressed="true"] { background: #fff; color: var(--teal-700); box-shadow: inset 0 0 0 1px var(--line); }
.tool-btn:disabled { opacity: .4; cursor: not-allowed; }
.tool-btn .ic { width: 17px; height: 17px; }
.star-btn.on { color: #6e5500; border-color: #f0d36b; background: #fff8d9; }
.star-btn.on .ic { fill: var(--brand-yellow); }
@media (max-width: 1180px) { .tool-btn .lbl { display: none; } .tool-btn { padding: 0 8px; } }
.ws-body { position: relative; flex: 1; min-height: 0; display: flex; }
.ws-stage { position: relative; flex: 1; min-width: 0; background: #fff; }
.ws-frame { position: absolute; inset: 0; background: #fff; }
.ws-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.ws-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .96); padding: 24px; text-align: center; z-index: 2;
}
.ws-overlay-in { max-width: 420px; }
.ws-overlay .app-ic.lg { margin: 0 auto 16px; }
.ws-overlay h3 { font-size: 1.1rem; margin-bottom: 6px; }
.ws-overlay p { color: var(--muted); font-size: .9rem; }
.ws-overlay .btn-row { justify-content: center; margin-top: 18px; }
.ws-loadbar { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; z-index: 3; }
.ws-loadbar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; background: var(--teal-500); animation: indet 1.2s ease-in-out infinite; }
.ws-panel {
  width: 340px; flex: none; background: #fff; border-left: 1px solid var(--line); overflow-y: auto; padding: 24px;
}
.ws-panel-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.ws-panel-head h2 { margin: 0 0 4px; font-size: 1.1rem; }
.ws-panel .desc { white-space: pre-line; color: var(--ink-2); font-size: .9rem; }
.ws-panel .kv { grid-template-columns: 84px 1fr; font-size: .86rem; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.ws-empty { flex: 1; display: grid; place-items: center; padding: 24px; }
.ws-hint {
  position: absolute; right: 16px; bottom: 16px; z-index: 4; display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  font-size: .84rem; color: var(--ink-2); transition: opacity .3s, transform .3s; max-width: calc(100% - 32px);
}
.ws-hint .ic { color: var(--teal-600); }
.ws-hint.hide { opacity: 0; transform: translateY(6px); }
.ws-hint .icon-btn { width: 30px; height: 30px; }
.ws-stage:fullscreen { background: #fff; }

/* ====================== マイアプリ・アプリ詳細 ====================== */
.app-list { display: flex; flex-direction: column; gap: 10px; }
.app-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px;
  transition: border-color .15s, box-shadow .15s;
}
.app-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.app-row-main { min-width: 0; }
.app-row-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-row-title a { font-weight: 700; color: var(--ink); font-size: .98rem; }
.app-row-sub { font-size: .8rem; color: var(--muted); display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 2px; }
.app-row-actions { display: flex; gap: 6px; }
.app-row-when { font-size: .8rem; color: var(--muted); white-space: nowrap; text-align: right; }

.detail-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.detail-head .grow h1 { margin: 0 0 6px; font-size: 1.45rem; }
.detail-sub { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-preview { max-width: 320px; pointer-events: none; }
.card-preview .acard { box-shadow: var(--shadow); }
.preview-label { font-size: .76rem; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }

/* 色・アイコンの選択 */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; padding: 0; position: relative;
  background: var(--ac); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .0);
}
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ac); }
.swatch.on::after { content: ""; position: absolute; left: 12px; top: 8px; width: 7px; height: 13px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, 40px); gap: 6px; }
.emoji-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 20px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; padding: 0; color: var(--muted);
}
.emoji-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.emoji-btn.on { border-color: var(--teal-500); background: var(--teal-50); box-shadow: inset 0 0 0 1px var(--teal-500); }
.emoji-btn .ic { width: 18px; height: 18px; }
.cat-pick { display: flex; gap: 8px; flex-wrap: wrap; }

/* ====================== モーダル ====================== */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(11, 26, 49, .48);
  display: flex; align-items: center; justify-content: center; padding: 32px 16px; overflow: hidden;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  width: 100%; max-width: 480px; max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px);
  display: flex; flex-direction: column; animation: rise .2s ease;
}
@keyframes rise { from { transform: translateY(8px); opacity: .6; } }
.modal-wide { max-width: 760px; }
.modal-xl { max-width: 920px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.08rem; }
.modal-x {
  border: 0; background: transparent; cursor: pointer; color: var(--muted); width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center; padding: 0;
}
.modal-x:hover { background: var(--navy-50); color: var(--ink); }
.modal-x:disabled { visibility: hidden; }
.modal-x .ic { width: 20px; height: 20px; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.modal-head { flex: none; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.modal-body > .modal-foot:last-child, .modal-body .sticky-foot {
  position: sticky; bottom: -24px; z-index: 3; background: #fff; margin: 24px -24px -24px; padding: 14px 24px 18px;
}
.modal-foot .spacer { margin-right: auto; }

/* ====================== アプリを追加（3 ステップ） ====================== */
.stepper { display: flex; align-items: center; gap: 0; margin: -4px 0 24px; }
.stepper .st { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .88rem; font-weight: 600; white-space: nowrap; }
.stepper .st-no {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 1.5px solid var(--line-strong); color: var(--muted); font: 600 .84rem/1 var(--font-num); background: #fff;
}
.stepper .st.on { color: var(--ink); }
.stepper .st.on .st-no { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.stepper .st.done .st-no { background: var(--teal-50); border-color: var(--teal-500); color: var(--teal-700); }
.stepper .st-line { flex: 1; height: 1.5px; background: var(--line); margin: 0 14px; min-width: 16px; }
.stepper .st-line.done { background: var(--teal-500); }
.drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2);
  padding: 36px 20px; text-align: center; transition: background .15s, border-color .15s;
}
.drop.over { border-color: var(--teal-500); background: var(--teal-50); }
.drop-icon { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center; background: #fff; color: var(--teal-600); box-shadow: var(--shadow); }
.drop-icon .ic { width: 26px; height: 26px; }
.drop-main { font-weight: 700; font-size: 1.02rem; margin: 0 0 4px; }
.drop-sub { color: var(--muted); font-size: .86rem; margin: 0 0 18px; }
.drop .btn-row { justify-content: center; }
.analysis { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.picked.over .analysis { border-color: var(--teal-500); box-shadow: 0 0 0 3px var(--teal-50); }
.drop[hidden] + .picked .analysis { margin-top: 0; }
.analysis-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: #fff; }
.analysis-head .ficon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy-700); flex: none; }
.analysis-head .ficon .ic { width: 22px; height: 22px; }
.analysis-head b { font-size: .98rem; }
.analysis-rows { border-top: 1px solid var(--line); background: var(--surface-2); padding: 6px 18px; }
.a-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; font-size: .88rem; align-items: start; }
.a-row + .a-row { border-top: 1px solid var(--line); }
.a-k { color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.a-k .ic { width: 15px; height: 15px; }
.a-v { min-width: 0; }
.a-v .chips { gap: 6px; }
.fw-tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.fw-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500); }
.fw-tag.bad .dot { background: var(--danger); }
.fw-tag.unk .dot { background: var(--faint); }
.skipped summary { cursor: pointer; color: var(--muted); }
.skipped ul { margin: 6px 0 0; padding-left: 20px; max-height: 160px; overflow: auto; font-family: var(--mono); font-size: .78rem; }
.add-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.add-grid .card-preview { position: sticky; top: 0; }
.name-line { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.name-line .mono { color: var(--ink-2); }
.name-msg { font-size: .84rem; margin-top: 6px; min-height: 1.4em; }
.msg-ok { color: var(--ok); }
.msg-err { color: var(--danger); font-weight: 600; }
.msg-info { color: var(--navy-700); font-weight: 600; }
.progress-box { padding: 28px 0 12px; text-align: center; }
.progress-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.progress-steps { display: flex; justify-content: center; gap: 8px 22px; flex-wrap: wrap; margin: 18px 0 16px; font-size: .84rem; color: var(--faint); }
.progress-steps span { display: inline-flex; align-items: center; gap: 6px; }
.progress-steps span.on { color: var(--ink); font-weight: 600; }
.progress-steps span.done { color: var(--teal-700); }
.progress-steps .ic { width: 15px; height: 15px; }
.bar { height: 6px; background: var(--navy-50); border-radius: 999px; overflow: hidden; position: relative; max-width: 460px; margin: 0 auto; }
.bar-fill { height: 100%; width: 0; background: var(--teal-500); border-radius: 999px; transition: width .2s; }
.bar.indeterminate .bar-fill { width: 30% !important; position: absolute; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { 0% { left: -30%; } 100% { left: 100%; } }
.progress-sub { margin-top: 12px; color: var(--muted); font-size: .86rem; }
.result-head { text-align: center; margin-bottom: 20px; }
.ok-icon {
  width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok);
  display: grid; place-items: center; margin: 0 auto 12px;
}
.ok-icon .ic { width: 28px; height: 28px; stroke-width: 2.4; }
.result-head h3 { font-size: 1.25rem; margin: 0 0 4px; }
.preview-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.preview-frame-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: .8rem; color: var(--muted); }
.preview-frame-bar .dots { display: flex; gap: 5px; }
.preview-frame-bar .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); display: block; }
.preview-frame iframe { width: 100%; height: 260px; border: 0; display: block; }
.preview-fail { display: flex; gap: 12px; align-items: flex-start; padding: 24px 20px; color: var(--ink-2); }
.preview-fail > .ic { color: var(--warn); margin-top: 2px; }
.draft-actions { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius); background: var(--teal-50); border: 1px solid var(--teal-100); margin-top: 18px; flex-wrap: wrap; }
.draft-actions .grow b { display: block; }
.draft-actions .grow span { font-size: .86rem; color: var(--ink-2); }

/* ====================== 診断レポート ====================== */
.report { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; text-align: left; }
.report h4 { margin: 0 0 6px; font-size: .92rem; }
.report-summary { font-weight: 600; }
.report-sec > summary, .excl-group > summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.steps { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; }
.steps li { display: grid; grid-template-columns: 20px auto 1fr; gap: 8px; align-items: baseline; font-size: .88rem; }
.step-mark { font-weight: 700; width: 20px; text-align: center; }
.step-ok .step-mark { color: var(--ok); }
.step-ng .step-mark { color: var(--danger); }
.step-skip .step-mark { color: var(--muted); }
.step-name { font-weight: 600; white-space: nowrap; }
.step-detail { color: var(--muted); font-size: .84rem; }
.problems { display: flex; flex-direction: column; gap: 10px; }
.problem { border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px; padding: 12px 14px; background: #fff; }
.problem.lv-error { border-left-color: var(--danger); }
.problem.lv-warn { border-left-color: #d99a1e; }
.problem.lv-info { border-left-color: var(--navy-600); }
.problem-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.problem .lv { font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.lv-error .lv { background: var(--danger-soft); color: var(--danger); }
.lv-warn .lv { background: var(--warn-soft); color: var(--warn); }
.lv-info .lv { background: var(--navy-50); color: var(--navy-700); }
.problem-detail { font-size: .88rem; margin-top: 4px; }
.todo { margin-top: 10px; padding: 10px 12px; background: var(--teal-50); border-radius: 8px; font-size: .88rem; }
.todo-k { font-weight: 700; color: var(--teal-700); font-size: .8rem; }
.excl ul { margin: 4px 0 6px; padding-left: 22px; font-family: var(--mono); font-size: .78rem; max-height: 180px; overflow: auto; }
.excl-group { margin: 4px 0 0 12px; }
.excl-group > summary { font-weight: 500; }
.aibox { border: 1px solid var(--navy-100); border-radius: 10px; overflow: hidden; }
.aibox-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 14px; background: var(--navy-50); font-weight: 700; color: var(--navy-800); }
.aibox-hint { margin: 10px 14px 0; }
.aibox-body { padding: 4px 14px 12px; }
.aibox-body summary { cursor: pointer; font-size: .84rem; color: var(--muted); }
.aibox-body pre { white-space: pre-wrap; font-size: .8rem; max-height: 300px; overflow: auto; background: var(--surface-2); padding: 10px; border-radius: 8px; margin: 6px 0 0; }
.report-fail { border: 1px solid var(--danger-line); background: #fffafa; border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.fail-head { display: flex; gap: 12px; align-items: flex-start; color: #8f2a20; }
.ng-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--danger); color: #fff; flex: none; display: grid; place-items: center; font-weight: 700; }
.result-report { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.panel-sum { cursor: pointer; list-style: none; }
.panel-sum::-webkit-details-marker { display: none; }
.panel-sum h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.panel-sum::before { content: "\25B8"; color: var(--muted); margin-right: 8px; }
details[open] > .panel-sum::before { content: "\25BE"; }
details[open] > .panel-sum { margin-bottom: 12px; }

/* テスト結果 */
.test-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.test-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; }
.test-status .badge { font-size: .86rem; padding: 4px 12px; }
.checks { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.checks li { display: flex; gap: 8px; align-items: flex-start; }
.checks li.ok .step-mark { color: var(--ok); }
.checks li.ng .step-mark { color: var(--danger); }
.shots { display: grid; grid-template-columns: 3fr 1fr; gap: 16px; align-items: start; }
.shot { margin: 0; }
.shot img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.shot figcaption { font-size: .82rem; color: var(--muted); margin-top: 6px; text-align: center; }
.shot-missing-msg { display: none; padding: 30px 10px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 10px; }
.shot.shot-missing a { display: none; }
.shot.shot-missing .shot-missing-msg { display: block; }
.errlist { margin: 8px 0; }
.errlist summary { cursor: pointer; font-weight: 600; }
.errlist ul { margin: 6px 0 0; padding-left: 20px; font-family: var(--mono); font-size: .8rem; max-height: 280px; overflow: auto; }
.ct-counts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }

/* ====================== 管理 ====================== */
.role-pill { display: inline-flex; }
.csv-preview { max-height: 220px; overflow: auto; }
.provider { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; background: var(--navy-50); font-weight: 600; font-size: .88rem; }
.provider .pv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.provider.ok .pv-dot { background: var(--teal-500); }
.provider.bad { background: var(--danger-soft); color: var(--danger); }
.provider.bad .pv-dot { background: var(--danger); }
.ev-list { display: flex; flex-direction: column; }
.ev-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; }
.ev-row + .ev-row { border-top: 1px solid var(--line); }
.ev-row .ev-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--navy-50); color: var(--navy-700); display: grid; place-items: center; flex: none; }
.ev-row .grow b { display: block; font-size: .92rem; }
.ev-row .grow span { font-size: .82rem; color: var(--muted); }
.ip-rows { display: flex; flex-direction: column; gap: 8px; }
.ip-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.ip-row .input { min-height: 38px; }
.your-ip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 10px; background: var(--navy-50); font-size: .9rem; margin-bottom: 16px; }
.your-ip .mono { font-weight: 600; }
.howto { padding-left: 1.4em; margin: 0 0 12px; }
.howto li { margin: 8px 0; }
.howto-title { margin-top: 0; }
.saved-hint { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ts-wrap { margin: 4px 0 14px; }
.ts-box { min-height: 65px; display: flex; justify-content: center; align-items: center; }
.ts-box:empty { min-height: 0; }
.ts-wrap .hint { text-align: center; }
.ts-test { margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2); }
.ts-test .ts-box { justify-content: flex-start; margin: 8px 0; }
.sec-hist-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sec-hist-head h2 { margin: 0; }
.tbl-login tr.ng td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.btn-unlock { border-color: var(--danger-line); color: var(--danger); }
.grid-2-tight { gap: 28px; }
.grid-2-tight > div { min-width: 0; }
.dev-cell { display: flex; align-items: center; gap: 10px; }
.dev-cell .dev-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--navy-50); color: var(--navy-700); display: grid; place-items: center; flex: none; }
.cred-list { display: flex; flex-direction: column; gap: 8px; }
.cred { display: grid; grid-template-columns: 100px 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.cred-k { font-weight: 600; color: var(--muted); font-size: .86rem; }
.cred-v { font-family: var(--mono); font-size: .95rem; word-break: break-all; }
.codeblock { position: relative; margin: 8px 0 14px; }
.codeblock pre { margin: 0; padding: 14px 16px; padding-right: 96px; background: var(--navy-950); color: #dbe3ee; border-radius: 10px; white-space: pre-wrap; word-break: break-all; font-size: .84rem; }
.codeblock .btn { position: absolute; top: 8px; right: 8px; }
.tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.tip .tip-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--teal-50); color: var(--teal-700); display: grid; place-items: center; margin-bottom: 10px; }
.tip b { display: block; margin-bottom: 4px; }
.tip p { font-size: .86rem; color: var(--ink-2); margin: 0; }
.guide-files { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 20px; }
.guide-file { display: flex; gap: 14px; align-items: flex-start; margin: 0; }
.guide-file h2 { margin: 0; }
.guide-ic { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--navy-50); color: var(--navy-700); }
.guide-pre { white-space: pre-wrap; font-size: .8rem; max-height: 60vh; overflow: auto; background: var(--surface-2); padding: 12px; border-radius: 10px; margin: 0; }

/* ====================== 端末の承認待ち・IP 拒否 ====================== */
.gate { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: linear-gradient(160deg, #fbfdfe 0%, #eaf3f8 100%); }
.gate-card { width: 100%; max-width: 480px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 36px 32px; text-align: center; }
.gate-card .gate-ic { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 18px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); }
.gate-card .gate-ic .ic { width: 30px; height: 30px; }
.gate-card .gate-ic.bad { background: var(--danger-soft); color: var(--danger); }
.gate-card h1 { font-size: 1.3rem; margin-bottom: 8px; }
.gate-card > p { color: var(--muted); }
.gate-card form { text-align: left; margin-top: 22px; }
.gate-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line); color: var(--brand-ink); font-weight: 700; letter-spacing: .12em; font-size: .92rem; }
.gate-brand img { width: 240px; max-width: 100%; height: auto; }

.gate-steps { text-align: left; margin: 18px 0 0; padding: 14px 16px; border-radius: 10px; background: var(--surface-2); font-size: .86rem; color: var(--ink-2); }
.gate-steps ol { margin: 0; padding-left: 1.3em; }
.gate-foot { margin-top: 22px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ====================== ログイン ====================== */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.login-intro {
  position: relative; overflow: hidden; isolation: isolate; padding: 52px 60px 40px; display: flex; flex-direction: column;
  background: linear-gradient(150deg, #ffffff 0%, #f1f8fb 40%, #dcebf6 100%); border-right: 1px solid var(--line); color: var(--ink-2);
}
.login-intro::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--brand) 0%, var(--brand-sky) 70%, var(--brand-yellow) 100%); }
.login-art { position: absolute; inset: 0; z-index: -1; }
.login-art .road-art { position: absolute; inset: auto 0 0 0; height: 62%; width: 100%; }
.login-logo { width: 340px; max-width: 100%; height: auto; display: block; }
.login-portal { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.login-portal .pn-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: inset 0 -3px 0 var(--brand-yellow); }
.login-portal .pn-ic .ic { width: 22px; height: 22px; }
.login-portal b { display: block; font-size: 1.2rem; color: var(--brand-ink); letter-spacing: .12em; }
.login-portal small { display: block; font-size: .78rem; color: var(--muted); letter-spacing: .1em; }
.login-copy { margin: auto 0; padding: 40px 0; max-width: 480px; position: relative; }
.login-copy h1 { color: var(--brand-ink); font-size: 2rem; line-height: 1.55; letter-spacing: .06em; margin-bottom: 16px; font-weight: 700; }
.login-copy h1 em { font-style: normal; color: var(--brand-mid); }
.login-copy p { color: var(--ink-2); font-size: .98rem; }
.safety { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-direction: column; gap: 14px; }
.safety li { display: flex; gap: 14px; align-items: flex-start; }
.safety .s-ic { width: 38px; height: 38px; border-radius: 10px; background: #fff; color: var(--brand); display: grid; place-items: center; flex: none; border: 1px solid var(--brand-line); box-shadow: 0 1px 2px rgba(26, 74, 152, .06); }
.safety b { color: var(--ink); display: block; font-size: .95rem; font-weight: 700; }
.safety span { font-size: .84rem; color: var(--muted); }
.login-legal { font-size: .76rem; color: var(--muted); position: relative; line-height: 1.7; }
.login-operator { display: none; margin: 18px 0 0; font-size: .74rem; color: var(--muted); text-align: center; }
.login-form-wrap { display: grid; place-items: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 1.5rem; margin-bottom: 6px; color: var(--brand-ink); letter-spacing: .08em; }
.login-card .sub { color: var(--muted); margin-bottom: 28px; font-size: .92rem; }
.login-card .btn-lg { width: 100%; margin-top: 4px; }
.login-card .btn:disabled { opacity: .6; cursor: not-allowed; }
.login-help { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-wrap .icon-btn { position: absolute; right: 4px; top: 3px; }

/* ====================== マニュアル ====================== */
.doc-top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.doc-top-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 12px 24px; }
.doc-brand { display: block; }
.doc-brand .corp-logo { width: 220px; }
.doc-top::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--brand-sky)); }

.doc-top .doc-title { display: flex; align-items: baseline; gap: 10px; font-weight: 500; color: var(--muted); padding-left: 18px; border-left: 1px solid var(--line); font-size: .9rem; }
.doc-top .doc-title b { color: var(--brand-ink); font-size: 1rem; letter-spacing: .1em; }
.site-foot { max-width: 1240px; margin: 0 auto; padding: 0 24px 40px; font-size: .78rem; color: var(--muted); text-align: right; }
.doc-top .btn { margin-left: auto; }
.manual-layout { max-width: 1240px; margin: 0 auto; padding: 32px 24px 72px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.doc-side { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.side-tabs { display: flex; flex-direction: column; gap: 2px; }
.side-tabs a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-weight: 600; color: var(--ink-2); font-size: .92rem; }
.side-tabs a .ic { color: var(--muted); }
.side-tabs a:hover { background: var(--brand-pale-2); color: var(--brand); text-decoration: none; }
.side-tabs a.active { background: var(--brand-pale); color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.side-tabs a.active .ic { color: var(--brand); }
.toc { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .85rem; }
.toc-label { font-size: .72rem; letter-spacing: .14em; color: var(--faint); padding: 0 12px 6px; font-weight: 600; }
.toc a { display: block; padding: 4px 12px; color: var(--muted); border-radius: 6px; line-height: 1.5; }
.toc a:hover { background: var(--navy-50); color: var(--ink); text-decoration: none; }
.toc a.lv3 { padding-left: 24px; font-size: .82rem; }
.md { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 48px; box-shadow: var(--shadow); min-width: 0; line-height: 1.85; }
.md h1 { font-size: 1.65rem; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.md h2 { font-size: 1.25rem; margin-top: 2.2em; padding-left: 12px; border-left: 3px solid var(--teal-500); }
.md h3 { font-size: 1.04rem; margin-top: 1.6em; }
.md h1, .md h2, .md h3 { scroll-margin-top: 90px; }
.md ul, .md ol { padding-left: 1.6em; margin: 0 0 1em; }
.md li { margin: .25em 0; }
.md img { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; }
.md pre { position: relative; background: var(--navy-950); color: #dbe3ee; padding: 16px 18px; border-radius: 10px; overflow-x: auto; font-size: .84rem; line-height: 1.6; }
.md pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.md pre .btn { position: absolute; top: 8px; right: 8px; }
.md blockquote { margin: 1em 0; padding: 12px 18px; background: var(--navy-50); border-left: 3px solid var(--navy-600); border-radius: 0 10px 10px 0; }
.md blockquote p:last-child { margin-bottom: 0; }
.md table { border-collapse: collapse; margin: 1em 0; display: block; overflow-x: auto; font-size: .92rem; }
.md th, .md td { border: 1px solid var(--line); padding: 8px 14px; text-align: left; }
.md th { background: var(--surface-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }

/* ====================== レスポンシブ ====================== */
@media (max-width: 1180px) {
  .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .view { padding: 28px 24px 64px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .guide-files { grid-template-columns: 1fr; }
  .add-grid { grid-template-columns: 1fr; }
  .add-grid .card-preview { display: none; }
  .ws-panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 5; box-shadow: var(--shadow-pop); }
  .login { grid-template-columns: 1fr; }
  .login-intro { padding: 28px 24px 28px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-art .road-art { height: 100%; }
  .login-logo { width: 260px; }
  .login-portal { margin-top: 18px; }
  .login-copy { padding: 22px 0 0; margin: 0; }
  .login-copy h1 { font-size: 1.36rem; }
  .login-operator { display: block; }
  .login-copy p { display: none; }
  .safety { flex-direction: row; flex-wrap: wrap; gap: 10px 18px; margin-top: 18px; }
  .safety li { align-items: center; gap: 8px; }
  .safety .s-ic { width: 28px; height: 28px; border-radius: 8px; }
  .safety .s-ic .ic { width: 15px; height: 15px; }
  .safety span { display: none; }
  .safety b { font-size: .84rem; }
  .login-legal { display: none; }
  .manual-layout { grid-template-columns: 1fr; padding: 20px 16px 56px; gap: 16px; }
  .doc-side { position: static; max-height: none; }
  .side-tabs { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .side-tabs a { white-space: nowrap; }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .side { transform: translateX(-100%); width: 280px !important; visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
  .app.drawer .side { transform: none; visibility: visible; box-shadow: var(--shadow-pop); transition: transform .25s ease; }
  .side-toggle { display: none; }
  .app.mini .nav-label, .app.mini .nav-link > span:not(.nav-count), .app.mini .user-meta, .app.mini .portal-name, .app.mini .operator { display: revert; }
  .app.mini .corp-logo { display: block; }
  .app.mini .corp-mark { display: none; }
  .app.mini .side-brand { padding: 22px 22px 18px; }
  .app.mini .portal-name { display: flex; }
  .app.mini .nav-link { justify-content: flex-start; padding: 9px 12px; }
  .app.mini .nav-count { position: static; }
  .main, .app.mini .main { margin-left: 0; }
  .mtop {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; height: var(--top-h);
    padding: 0 8px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  }
  .mtop-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
  .mtop-brand:hover { text-decoration: none; }
  .mtop .mtop-right { margin-left: auto; display: flex; gap: 2px; }
  .ws { height: calc(100dvh - var(--top-h)); }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .view { padding: 20px 16px 56px; }
  .home-hero h1 { font-size: 1.35rem; }
  .page-head { margin-bottom: 20px; }
  .page-head h1 { font-size: 1.3rem; }
  .rail { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail .mini-card { flex: 0 0 74%; scroll-snap-align: start; }
  .cards { grid-template-columns: 1fr; gap: 14px; }
  .section { margin-top: 32px; }
  .panel { padding: 18px 16px; }
  .stat-tiles { gap: 10px; }
  .stat { padding: 14px; }
  .stat-v { font-size: 1.5rem; }
  .modal-back { padding: 0; align-items: stretch; }
  .modal { max-height: none; height: 100%; }
  .modal-body > .modal-foot:last-child, .modal-body .sticky-foot { bottom: -18px; margin: 18px -16px -18px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
  .modal { border-radius: 0; min-height: 100%; }
  .modal-body { padding: 18px 16px; }
  .modal-head { padding: 14px 16px; }
  .stepper .st-label { display: none; }
  .stepper .st.on .st-label { display: inline; }
  .a-row { grid-template-columns: 1fr; gap: 4px; }
  .app-row { grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px; }
  .app-row-when { display: none; }
  .app-row-actions { grid-column: 1 / -1; }
  .app-row-actions .btn { flex: 1; }
  .kv { grid-template-columns: 96px 1fr; }
  .ip-row { grid-template-columns: 1fr auto; }
  .ip-row .ip-note { grid-column: 1 / 2; grid-row: 2; }
  .shots { grid-template-columns: 1fr; }
  .shot-mobile { max-width: 260px; margin: 0 auto; }
  .steps li { grid-template-columns: 20px 1fr; }
  .step-detail { grid-column: 2; }
  .cred { grid-template-columns: 1fr auto; }
  .cred-k { grid-column: 1 / -1; }
  .ws-bar { padding: 6px 6px 0; gap: 4px; }
  .ws-tab { min-width: 112px; flex-basis: 150px; }
  .ws-tools [data-ws=full] { display: none; }
  .tool-btn { padding: 0 7px; }
  .ws-hint { left: 12px; right: 12px; bottom: 12px; padding-left: 12px; font-size: .8rem; }
  .ws-hint > .ic { display: none; }
  .ws-hint > span { white-space: nowrap; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .rail { scroll-padding: 0 16px; }
  .ws-panel { width: 100%; }
  .md { padding: 22px 18px; }
  .doc-top-in { padding: 10px 16px; }
  .doc-top .doc-title { display: none; }
  .doc-brand .corp-logo { width: 170px; }
  .site-foot { text-align: center; }
  .gate-card { padding: 28px 20px; }
  .tbl th, .tbl td { padding: 10px; }
  .detail-head { gap: 14px; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
}

/* ====================== レビュー対応（2 回目） ====================== */
.choice-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.choice-list .btn { width: 100%; }
.nav-link .nav-ext { width: 14px; height: 14px; margin-left: auto; opacity: .5; }
.icon-btn-sm { width: 28px; height: 28px; border-radius: 7px; vertical-align: middle; color: var(--muted); }
.icon-btn-sm .ic { width: 15px; height: 15px; }
.ws-tools[hidden] { display: none !important; }
details.tech { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
details.tech:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
details.tech > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
details.tech > summary::-webkit-details-marker { display: none; }
details.tech > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin: 0 4px 0 2px; }
details.tech[open] > summary::before { transform: rotate(45deg); }
details.tech > summary h2, details.tech > summary h3 { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
details.tech[open] > summary { margin-bottom: 14px; }
.acard.no-thumb .thumb-ph::after { opacity: .7; }
.acard-flags-sm { display: none; }

/* 表：スマホでは 1 行を 1 枚のカードにする（.tbl-stack） */
@media (max-width: 600px) {
  .table-wrap:has(.tbl-stack) { border: 0; overflow: visible; }
  .tbl-stack thead { display: none; }
  .tbl-stack, .tbl-stack tbody, .tbl-stack tr, .tbl-stack td { display: block; width: 100%; }
  .tbl-stack tr { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
  .tbl-stack td { border: 0; padding: 4px 0; display: flex; align-items: center; gap: 12px; white-space: normal; text-align: left; }
  .tbl-stack td[data-label]::before { content: attr(data-label); flex: 0 0 84px; color: var(--muted); font-size: .78rem; font-weight: 600; }
  .tbl-stack td.actions { justify-content: flex-start; flex-wrap: wrap; gap: 6px; padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--line); }
  .tbl-stack td.actions .btn + .btn { margin-left: 0; }
  .tbl-stack td.actions:empty { display: none; }
  .tbl-login.tbl-stack tr.ng { box-shadow: inset 3px 0 0 var(--danger); }
  .tbl-login.tbl-stack tr.ng td:first-child { box-shadow: none; }
  .hide-sm { display: none !important; }

  /* カード：スマホでは画面写真を隠し、横並びの行にする（1 画面に 4〜5 件） */
  .cards { gap: 10px; }
  .acard { border-radius: 12px; }
  .acard::before { top: 0; bottom: 0; left: 0; right: auto; width: 3px; height: auto; }
  .acard-thumb { display: none; }
  .acard-body { padding: 12px 12px 12px 16px; gap: 4px; }
  .acard-head { align-items: center; gap: 10px; }
  .acard-head .app-ic { width: 36px; height: 36px; border-radius: 10px; font-size: 19px; }
  .acard-title { padding-top: 0; font-size: .95rem; }
  .acard-desc { min-height: 0; -webkit-line-clamp: 1; font-size: .82rem; padding-left: 46px; }
  .acard-desc.empty { display: none; }
  .acard-meta { padding: 2px 0 0 46px; font-size: .74rem; }
  .acard:hover { transform: none; }
  .acard-flags-sm { display: flex; gap: 6px; padding-left: 46px; }
}
@media (max-width: 600px) {
  .modal-body { display: flex; flex-direction: column; }
  .modal-body > .modal-foot:last-child { margin-top: auto; }
  .draft-actions { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px; }
  .draft-actions .btn { width: 100%; }
  .choice-list { margin-top: 14px; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .panel-head .btn-row { width: 100%; }
}

/* ====================== ブランド（TECMEX）共通 ====================== */
.corp-mark-sm { width: 30px; height: 30px; flex: none; }
.mark-name { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mark-name b { font-size: .98rem; color: var(--brand-ink); letter-spacing: .08em; }
.mark-name small { font-size: .66rem; color: var(--muted); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel { border-color: var(--line); }
.page-head h1 { color: var(--brand-ink); letter-spacing: .05em; }
.section-head h2 .ic { color: var(--brand-mid); }
.panel > h2 .ic, .panel-head h2 .ic { color: var(--brand-mid); }
.stat-k .ic { color: var(--brand-mid); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.tab .ic { color: inherit; }
a { color: var(--brand-mid); }
a:hover { color: var(--brand); }
.btn-primary { box-shadow: 0 1px 2px rgba(26, 74, 152, .2); }
.btn-primary:hover { box-shadow: 0 4px 12px rgba(26, 74, 152, .22); }
.acard { box-shadow: 0 1px 2px rgba(26, 74, 152, .04); }
.mini-card { box-shadow: 0 1px 2px rgba(26, 74, 152, .03); }
.app-ic { box-shadow: inset 0 0 0 1px rgba(26, 74, 152, .05); }
.ws-bar { background: var(--brand-pale-2); }
.ws { background: var(--brand-pale-2); }
.stepper .st.on .st-no { box-shadow: 0 0 0 4px var(--brand-pale); }
.drop { background: linear-gradient(180deg, #fbfdfe 0%, var(--brand-pale-2) 100%); border-color: var(--brand-line-2); }
.drop.over { border-color: var(--brand-mid); background: var(--brand-pale); }
.drop-icon { color: var(--brand); }
.draft-actions { background: linear-gradient(110deg, #fffdf2 0%, #fff8da 100%); border-color: #f2df8f; }
.empty-state .empty-ic { background: var(--brand-pale); color: var(--brand); }
.note.info { background: var(--brand-pale); border-color: var(--brand-line); color: var(--brand-ink); }
.tbl th { background: var(--brand-pale); color: #46596b; }
.table-wrap { border-color: var(--line); }
.md h2 { border-left-color: var(--brand); color: var(--brand-ink); }
.md h1 { color: var(--brand-ink); }
.md th { background: var(--brand-pale); }
.md blockquote { background: var(--brand-pale); border-left-color: var(--brand-mid); }
.toggle input:checked + .sw { background: var(--brand); }
.check input { accent-color: var(--brand); }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ac); }
.emoji-btn.on { border-color: var(--brand-mid); background: var(--brand-pale); box-shadow: inset 0 0 0 1px var(--brand-mid); }
.gate-card { box-shadow: var(--shadow-hover); border-color: var(--brand-line); }
.gate-card .gate-ic { background: var(--brand-pale); color: var(--brand); }
.provider.ok .pv-dot { background: var(--brand-mid); }
.ws-loadbar::after { background: var(--brand-mid); }
.bar-fill { background: var(--brand-mid); }
.meter > div { background: var(--brand-sky); }
.ev-row .ev-ic { background: var(--brand-pale); color: var(--brand); }
.tip .tip-ic { background: var(--brand-pale); color: var(--brand); }
.guide-ic { background: var(--brand-pale); color: var(--brand); }
@media (max-width: 860px) {
  .hero-band { padding: 22px 20px 22px 22px; border-radius: 14px; }
}
@media (max-width: 600px) {
  .hero-band { margin: -4px -4px 16px; }
  .home-hero { margin-bottom: 16px; }
  .home-hero h1 { font-size: 1.3rem; }
  .road-art { opacity: .8; }
}
.acard-flag .badge-new { background: var(--brand-yellow); color: var(--brand-yellow-ink); }
/* 各画面の見出し：下に細い線と、ブランドの青の短い線（ホームの帯と調子をそろえる） */
.page-head {
  padding-bottom: 18px;
  background: linear-gradient(var(--brand), var(--brand)) left bottom / 44px 2px no-repeat,
              linear-gradient(var(--line), var(--line)) left bottom / 100% 1px no-repeat;
}
.page-head .lead { color: var(--ink-2); }
.login-art .road-art { height: 44%; opacity: .85; }
@media (max-width: 960px) { .login-art .road-art { height: 100%; opacity: .7; } }

/* サイドバーを詰める（管理者のメニューが 800px の高さに収まるように） */
.side-brand { padding: 18px 20px 14px; }
.portal-name { margin-top: 12px; padding-top: 12px; }
.pn-ic { width: 30px; height: 30px; border-radius: 8px; }
.pn-ic .ic { width: 17px; height: 17px; }
.side-nav { padding: 10px 12px 10px; }
.nav-group + .nav-group { margin-top: 12px; }
.nav-label { padding-bottom: 4px; }
.nav-link { padding: 8px 12px; }
.nav-link.active::before { top: 7px; bottom: 7px; }
.foot-row { display: flex; align-items: center; gap: 4px; }
.foot-row .user-btn { flex: 1; min-width: 0; }
.foot-row .side-toggle { margin: 0; padding: 0; width: 34px; height: 34px; justify-content: center; flex: none; }
.foot-row .side-toggle span { display: none; }
.app.mini .foot-row { flex-direction: column; gap: 6px; }
.app.mini .foot-row .side-toggle { margin: 0; }
.page-head:has(+ .tabs) { background: none; padding-bottom: 0; }
.foot-row .side-toggle { position: relative; }
.foot-row .side-toggle::before { content: ""; position: absolute; left: -3px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.app.mini .foot-row .side-toggle::before { display: none; }

.gate { isolation: isolate; overflow: hidden; }
.gate > .road-art-gate { inset: auto 0 0 0; height: 42%; opacity: .9; }

/* ====================== 配色の見直し（60-30-10） ======================
   60%：白とニュートラルなグレー（面）／30%：TECMEX の濃い青（主ボタン・選択中・見出しの印・ヒーロー）
   10%：差し色（黄 #FCC800 とカテゴリの色） */
:root {
  /* カテゴリの色（--c は色帯・アイコン、--c-ink は文字・選択中の地、--c-soft はアイコンの地） */
  --cat-inspect: #1f75b7; --cat-inspect-ink: #1a5f96; --cat-inspect-soft: #e9f1f9;
  --cat-asset: #2a8c82;   --cat-asset-ink: #1f6d65;   --cat-asset-soft: #e6f3f1;
  --cat-gis: #3c8d5a;     --cat-gis-ink: #2e6f46;     --cat-gis-soft: #e8f3ec;
  --cat-report: #b7791f;  --cat-report-ink: #8a5a10;  --cat-report-soft: #fbf2e2;
  --cat-other: #5b6675;   --cat-other-ink: #4a5462;   --cat-other-soft: #eef0f3;
}
.cat-inspect { --ac: var(--cat-inspect); --acs: var(--cat-inspect-soft); --aci: var(--cat-inspect-ink); }
.cat-asset   { --ac: var(--cat-asset);   --acs: var(--cat-asset-soft);   --aci: var(--cat-asset-ink); }
.cat-gis     { --ac: var(--cat-gis);     --acs: var(--cat-gis-soft);     --aci: var(--cat-gis-ink); }
.cat-report  { --ac: var(--cat-report);  --acs: var(--cat-report-soft);  --aci: var(--cat-report-ink); }
.cat-other   { --ac: var(--cat-other);   --acs: var(--cat-other-soft);   --aci: var(--cat-other-ink); }
.acard-cat { color: var(--aci, var(--muted)); font-weight: 600; }
.acard-cat .ic { color: var(--ac); }
.cat-chip .ic { color: var(--ac); }
.cat-chip.on { background: var(--aci); border-color: var(--aci); color: #fff; box-shadow: none; }
.cat-chip.on .ic { color: #fff; }
.cat-badge { background: var(--acs); color: var(--aci); }
.thumb-ph { color: var(--ac); }

/* 面：グレーと白。淡い青は「選択中・強調」だけ */
body { background: var(--bg); }
.side { background: #fff; border-right-color: var(--line); }
.side-brand, .side-foot { border-color: var(--line); }
.portal-name { border-top-color: var(--line); }
.nav-link { color: var(--ink-2); }
.nav-link .ic { color: var(--muted); }
.nav-link:hover { background: var(--soft); color: var(--ink); }
.nav-link:hover .ic { color: var(--ink-2); }
.nav-link.active { background: var(--brand-pale); color: var(--brand); }
.nav-link.active .ic { color: var(--brand); }
.user-btn:hover, .side-toggle:hover { background: var(--soft); color: var(--ink); }
.ws, .ws-bar { background: var(--soft); }
.ws-tab:hover { background: rgba(255, 255, 255, .7); }
.drop { background: var(--surface-2); border-color: var(--line-strong); }
.drop.over { background: var(--brand-pale); border-color: var(--brand); }
.tbl th { background: var(--surface-2); color: var(--muted); }
.seg { background: var(--soft); }
.seg button.on { color: var(--brand); }
.empty-state .empty-ic, .ev-row .ev-ic, .tip .tip-ic, .guide-ic, .gate-card .gate-ic, .analysis-head .ficon, .dev-cell .dev-ic, .drop-icon {
  background: var(--soft); color: var(--brand);
}
.drop-icon { background: #fff; }
.chip { border-color: var(--line); color: var(--ink-2); }
button.chip:hover { border-color: var(--line-strong); color: var(--ink); background: #fff; }
.chip.on:not(.cat-chip) { background: var(--brand); border-color: var(--brand); color: #fff; }
.badge { background: var(--soft); color: var(--ink-2); }
.badge-pub { background: var(--brand-pale); color: var(--brand); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-err { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-draft { background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.badge-admin { background: var(--brand); color: #fff; }
.badge-creator { background: var(--brand-pale); color: var(--brand); }
.badge-viewer { background: var(--soft); color: var(--ink-2); }
.badge-new { background: var(--brand-yellow); color: var(--brand-yellow-ink); }
.panel, .stat, .acard, .mini-card, .app-row { border-color: var(--line); }
.acard:hover, .mini-card:hover, .app-row:hover { border-color: var(--line-strong); }
.your-ip, .gate-steps, .analysis-rows, .preview-frame-bar { background: var(--surface-2); }
.icon-btn:hover, .tool-btn:hover, .ws-tab-x:hover, .modal-x:hover, .star:hover, .btn-ghost:hover { background: var(--soft); }
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-accent:hover { background: var(--brand-mid-hover); border-color: var(--brand-mid-hover); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.stepper .st.on .st-no { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-pale); }
.stepper .st.done .st-no { background: #fff; border-color: var(--brand); color: var(--brand); }
.stepper .st-line.done { background: var(--brand); }
.note.info { background: var(--brand-pale); border-color: #cbd9ef; color: var(--brand-ink); }
.meter { background: var(--soft); }
.meter > div { background: var(--brand); }
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
.toggle .sw { background: #c3c9d1; }

/* ホーム上部：濃い青の帯（白い文字・白い線画）で青をはっきり見せる */
.hero-band {
  background: linear-gradient(118deg, #163f85 0%, var(--brand) 42%, #1d63ad 78%, var(--brand-mid) 100%);
  border: 0; color: #fff; box-shadow: 0 10px 30px rgba(26, 74, 152, .18);
}
.hero-band::after { width: auto; height: 3px; top: auto; bottom: 0; left: 0; right: 0; background: linear-gradient(90deg, var(--brand-yellow) 0 64px, transparent 64px); }
.hero-band .road-art { color: #fff; opacity: .55; }
.hero-band .home-hero h1 { color: #fff; }
.hero-band .home-hero p { color: rgba(255, 255, 255, .86); }
.hero-band .eyebrow { color: #fff; }
.hero-band .eyebrow::before { background: var(--brand-yellow); }
.hero-band .search-lg .input { border-color: transparent; box-shadow: 0 6px 20px rgba(9, 30, 66, .22); }
.hero-band .search .kbd { background: var(--soft); }
/* 青い帯の上の主ボタン：ミントグリーン（黄の「新着」と被らず、青の上で爽やかに目立つ）。
   文字は深い緑 #0B5A43（地とのコントラスト約 6.2:1） */
.btn-onbrand {
  background: linear-gradient(180deg, #d9f7ea 0%, #b5ecd4 100%);
  border-color: transparent; color: #0b5a43; font-weight: 700; letter-spacing: .02em;
  border-radius: 999px; padding-inline: 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 6px 18px rgba(9, 30, 66, .28), 0 1px 3px rgba(9, 30, 66, .18);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-onbrand svg { color: #0b5a43; }
.btn-onbrand:hover {
  background: linear-gradient(180deg, #e6fbf1 0%, #a3e6c8 100%); border-color: transparent; color: #084a37;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .75) inset, 0 10px 24px rgba(9, 30, 66, .32), 0 2px 4px rgba(9, 30, 66, .18);
}
.btn-onbrand:active { transform: translateY(0); filter: brightness(.97); }
.btn-onbrand:focus-visible { outline: none; box-shadow: 0 0 0 2px #0b5a43, 0 0 0 5px #fff; }

/* ログイン：左は濃い青の帯（ロゴは白い台に載せる）、右は白 */
.login { background: #fff; }
.login-intro {
  background: linear-gradient(155deg, #163f85 0%, var(--brand) 45%, #1d63ad 85%, var(--brand-mid) 100%);
  color: rgba(255, 255, 255, .9); border-right: 0;
}
.login-intro::before { height: 4px; background: linear-gradient(90deg, var(--brand-yellow) 0 96px, transparent 96px); top: auto; bottom: 0; }
.login-art .road-art { color: #fff; opacity: .45; }
.login-logo-plate { display: inline-block; align-self: flex-start; background: #fff; border-radius: 12px; padding: 14px 20px; box-shadow: 0 8px 24px rgba(9, 30, 66, .18); }
.login-logo { width: 300px; }
.login-portal b { color: #fff; }
.login-portal small { color: rgba(255, 255, 255, .78); }
.login-portal .pn-ic { background: #fff; color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand-yellow); }
.login-copy h1 { color: #fff; }
.login-copy h1 em { color: var(--brand-yellow); }
.login-copy p { color: rgba(255, 255, 255, .86); }
.safety .s-ic { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); color: #fff; box-shadow: none; }
.safety b { color: #fff; }
.safety span { color: rgba(255, 255, 255, .78); }
.login-legal { color: rgba(255, 255, 255, .75); }
.login-card h2 { color: var(--ink); }
.login-help { border-top-color: var(--line); }

/* サイドバーの「お試しボックス」の印・アイコンの地 */
.pn-ic { background: var(--brand); }
.app-ic { box-shadow: none; }

/* 承認待ち：グレーの地に濃い青の線画 */
.gate { background: var(--bg); }
.gate > .road-art-gate { color: var(--brand); opacity: .35; }
.gate-card { border-color: var(--line); box-shadow: var(--shadow-hover); }

/* マニュアル */
.side-tabs a:hover { background: var(--soft); color: var(--ink); }
.md blockquote { background: var(--surface-2); border-left-color: var(--brand); }
.md th { background: var(--surface-2); }

@media (max-width: 960px) {
  .login-logo { width: 230px; }
  .login-logo-plate { padding: 10px 14px; }
}
@media (max-width: 600px) {
  .hero-band { margin: -4px -4px 16px; }
}

/* ====================== 名称：TECMEX Junction ====================== */
.pn-text b, .mark-name b, .login-portal b, .jname, .gate-brand span {
  font-family: var(--font-num); font-weight: 700; letter-spacing: .01em;
}
.pn-text b { font-size: 1.02rem; }
.login-portal b { font-size: 1.24rem; }
.doc-top .doc-title b.jname { letter-spacing: .01em; }
.hero-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.hero-top .eyebrow { margin-bottom: 0; }
.hero-label {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px 3px 9px; border-radius: 999px;
  font: 600 .78rem/1.6 var(--font-num); letter-spacing: .02em; color: #fff;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.hero-label .ic { width: 15px; height: 15px; color: var(--brand-yellow); }
.pn-ic .ic { stroke-width: 2.1; }
.hero-label .ic { stroke-width: 2.1; }

/* ====================== いいね（👍） ====================== */
.kudos-btn {
  position: relative; z-index: 3; display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 32px; padding: 0 11px 0 9px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff;
  color: var(--ink-2); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .12s;
}
.kudos-btn .ic { width: 16px; height: 16px; }
.kudos-btn .kudos-n { min-width: 1ch; }
.kudos-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-pale-2); }
.kudos-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.kudos-btn.on .ic { fill: rgba(255, 255, 255, .22); }
.kudos-btn.on:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.kudos-btn:disabled { opacity: .55; cursor: not-allowed; background: #fff; color: var(--muted); border-color: var(--line); }
.kudos-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.kudos-btn.pop { transform: scale(1.08); }
.kudos-btn.kudos-lg { height: 36px; padding: 0 14px 0 12px; font-size: .88rem; }
.kudos-btn .kudos-label { margin-right: 2px; }
.acard-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.acard-foot .acard-meta { flex: 1; min-width: 0; margin-top: 0; padding-top: 0; }
.tool-kudos { display: inline-flex; align-items: center; margin: 0 4px; }
.tool-kudos:empty { display: none; }
.kudos-btn.kudos-tool { height: 32px; }
.kudos-users { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow: auto; }
.kudos-users li { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.avatar-sm { width: 26px; height: 26px; font-size: .74rem; background: var(--navy-600); }
@media (max-width: 600px) {
  .acard-foot { padding: 8px 0 0 46px; border-top: 0; gap: 8px; }
  .acard-foot .acard-meta { padding: 0; }
  .kudos-btn { height: 30px; padding: 0 10px 0 8px; }
}

.acard-meta { margin-top: auto; }
.acard-foot { justify-content: space-between; margin-top: 4px; padding-top: 10px; }
.acard-foot .acard-cat { margin-left: 0; font-size: .78rem; }
@media (max-width: 600px) {
  .acard-meta { padding: 2px 0 0 46px; }
  .acard-foot { padding: 6px 0 0 46px; margin-top: 0; }
}

/* ====== 公開前の自動テスト（公開ゲート） ====== */
.gate-box { margin: 0 0 18px; display: grid; gap: 12px; }
.gate-steps { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: .84rem; color: var(--muted); }
.gate-steps > span { display: inline-flex; align-items: center; gap: 6px; }
.gate-steps > span.done { color: var(--ok); }
.gate-steps > span.on { color: var(--navy-800); font-weight: 700; }
.gate-steps .spinner { width: 12px; height: 12px; margin: 0; }
.gate-head { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.gate-head > svg { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; }
.gate-head > .spinner { flex: 0 0 auto; margin: 3px 0 0; }
.gate-head b { display: block; font-size: 1rem; }
.gate-head span:not(.spinner) { display: block; font-size: .88rem; color: var(--ink-2); }
.gate-running { background: var(--navy-50); border-color: var(--navy-100); }
.gate-pass { background: var(--ok-soft); border-color: var(--ok-line); }
.gate-pass > svg { color: var(--ok); }
.gate-warn { background: var(--warn-soft); border-color: var(--warn-line); }
.gate-warn > svg { color: var(--warn); }
.gate-fail { background: var(--danger-soft); border-color: var(--danger-line); }
.gate-fail > svg { color: var(--danger); }
.gate-none > svg { color: var(--navy-600); }
.gate-lead { margin: -4px 0 0; }
.gate-findings { display: grid; gap: 10px; }
.gate-findings .problem.lv-info { border-left-color: var(--ok); }
.gate-findings .lv-info .lv { background: var(--ok-soft); color: var(--ok); }
.gate-detail { margin-top: 6px; }
.gate-detail summary { cursor: pointer; font-size: .82rem; color: var(--muted); }
.mono-wrap { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; white-space: pre-wrap; word-break: break-all; background: var(--navy-50); padding: 8px 10px; border-radius: 8px; max-height: 260px; overflow: auto; }
.gate-fix-row, .gate-actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gate-actions-row { justify-content: flex-end; padding-top: 4px; border-top: 1px solid var(--line); margin-top: 2px; }
.gate-actions { margin: 0; }
.gate-override { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.gate-override summary { cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.gate-override .field { margin: 10px 0 8px; }
.gate-override-note { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.gate-panel { margin-bottom: 20px; }
.gate-panel > .gate-head { margin-top: 4px; }
.gate-panel > * + * { margin-top: 12px; }
.badge-override { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 600px) {
  .gate-head { padding: 12px; }
  .gate-fix-row .btn, .gate-actions .btn { width: 100%; justify-content: center; }
  .gate-actions-row .btn { flex: 1 1 auto; justify-content: center; }
}
.gate-findings + .gate-ai, .gate-findings + .gate-override, .gate-ai + .gate-override { margin-top: 12px; }
@media (max-width: 600px) {
  .gate-fix-row .btn, .gate-actions .btn, .gate-actions-row .btn { white-space: normal; height: auto; min-height: 40px; padding-top: 8px; padding-bottom: 8px; text-align: center; }
}

/* アプリの操作：保存データ */
.saved-data { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.saved-data-title { display: flex; align-items: center; gap: 6px; font-size: .95rem; margin: 0 0 6px; }
.saved-data .muted { margin: 0 0 8px; }
.saved-data-status { margin: 0 0 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.saved-data-status .mono { overflow-wrap: anywhere; }
