/* 開発の共有サイト（TOTO 様向け。dev だけ）。色は :root の変数だけで決める */
:root {
  --c-bg: #f6f7f9;
  --c-surface: #ffffff;
  --c-surface-muted: #f1f3f5;
  --c-text: #1f2937;
  --c-muted: #5b6472;
  --c-border: #dadee5;
  --c-primary: #367f02;
  --c-primary-strong: #2b6204;
  --c-primary-alpha: rgba(54, 127, 2, .08);
  --c-on-primary: #ffffff;
  --c-focus: #1264fe;
  --c-bad: #b91c1c;
  --c-bad-bg: #fee2e2;
  --c-info-bg: #e2edff;
  --c-warn-bg: #fef6e6;
  --c-code-bg: #f3f4f6;
  --c-bar: #60a5fa;
  --c-bar-done: #1d4ed8;
  --c-milestone: #d97706;
  --c-today: #dc2626;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #111418; --c-surface: #1b1f24; --c-surface-muted: #23282e; --c-text: #e5e7eb; --c-muted: #a3aab5; --c-border: #343b44;
    --c-primary: #7cc24a; --c-primary-strong: #9bd66f; --c-primary-alpha: rgba(124, 194, 74, .12); --c-on-primary: #0b1a02;
    --c-bad: #f87171; --c-bad-bg: #3b1414; --c-info-bg: #16243d; --c-warn-bg: #33270f; --c-code-bg: #23282e;
    --c-bar: #3b82f6; --c-bar-done: #93c5fd; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--c-bg); color: var(--c-text); font: 16px/1.7 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; }
a { color: var(--c-primary-strong); }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--c-surface); padding: 8px; z-index: 30; }
.skip:focus { left: 8px; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.brand { font-weight: 700; font-size: 18px; color: var(--c-text); text-decoration: none; }
.brand small { margin-left: 8px; font-weight: 400; font-size: 14px; color: var(--c-muted); }
.env-tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--c-warn-bg); }
.who { margin-left: auto; font-size: 14px; color: var(--c-muted); display: flex; gap: 8px; align-items: center; }
.layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 0; min-height: calc(100vh - 52px); }
.nav { display: flex; flex-direction: column; padding: 16px 8px; gap: 2px; border-right: 1px solid var(--c-border); background: var(--c-surface); }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--c-text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--c-primary-alpha); color: var(--c-primary-strong); font-weight: 700; }
.nav[hidden] { display: none; }
.nav[hidden] + .main { grid-column: 1 / -1; }
.main { padding: 24px 28px 64px; max-width: 1200px; width: 100%; outline: none; }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--c-border); padding: 8px; }
  .nav a { white-space: nowrap; }
  .main { padding: 16px 16px 48px; }
  .brand small { display: none; }
}
h1.page-title { font-size: 24px; margin: 0 0 16px; outline: none; }
h2 { font-size: 19px; margin: 24px 0 10px; }
.muted { color: var(--c-muted); }
.error { color: var(--c-bad); background: var(--c-bad-bg); padding: 8px 12px; border-radius: 8px; }
.error[hidden] { display: none; }
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 16px 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.stat b { display: block; font-size: 28px; line-height: 1.2; }
.stat span { color: var(--c-muted); font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--c-primary); color: var(--c-on-primary); }
.btn-secondary { background: var(--c-surface); color: var(--c-primary-strong); border-color: var(--c-border); }
.btn-small { min-height: 34px; padding: 2px 10px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.form { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 700; font-size: 15px; }
.hint { margin: 0; font-size: 13px; color: var(--c-muted); }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); color: var(--c-text); }
textarea { resize: vertical; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { min-width: 240px; flex: 1; }
table.list { width: 100%; border-collapse: collapse; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--c-border); vertical-align: top; font-size: 15px; }
table.list th { background: var(--c-surface-muted); font-size: 13px; color: var(--c-muted); white-space: nowrap; }
table.list tr:last-child td { border-bottom: 0; }
.wrap { overflow-x: auto; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--c-border); white-space: nowrap; }
.status { color: #fff; border: 0; font-weight: 700; }
.meta { color: var(--c-muted); font-size: 13px; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; }
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.thread li { padding: 10px 12px; border-radius: 8px; background: var(--c-surface-muted); }
.thread li.is-haudi { background: var(--c-info-bg); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 40; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.loading { display: flex; gap: 8px; align-items: center; color: var(--c-muted); }
.spinner { width: 16px; height: 16px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dialog { border: 0; border-radius: var(--radius); padding: 20px; max-width: min(92vw, 460px); color: var(--c-text); background: var(--c-surface); }
.dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
/* 設計書の本文 */
.md { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px 24px; overflow-wrap: anywhere; }
.md h1 { font-size: 24px; } .md h2 { font-size: 20px; border-bottom: 1px solid var(--c-border); padding-bottom: 4px; } .md h3 { font-size: 17px; } .md h4 { font-size: 16px; }
.md table { border-collapse: collapse; margin: 8px 0 16px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--c-border); padding: 6px 10px; vertical-align: top; font-size: 15px; }
.md th { background: var(--c-surface-muted); }
.md pre { background: var(--c-code-bg); padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
.md code { background: var(--c-code-bg); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 8px 0; padding: 4px 14px; border-left: 4px solid var(--c-border); color: var(--c-muted); }
.md .mermaid-note { font-size: 13px; color: var(--c-muted); margin: 0 0 4px; }
.doc-list li { margin: 4px 0; }
/* 画面 */
.screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.screen { display: flex; flex-direction: column; gap: 6px; }
.screen .shot { aspect-ratio: 390 / 700; background: var(--c-surface-muted); border: 1px solid var(--c-border); border-radius: 8px; overflow: hidden; display: flex; align-items: flex-start; justify-content: center; }
.screen .shot img { width: 100%; height: auto; display: block; }
.screen-detail { display: grid; grid-template-columns: minmax(0, 390px) minmax(0, 1fr); gap: 20px; align-items: start; }
.screen-detail img { width: 100%; border: 1px solid var(--c-border); border-radius: 8px; }
@media (max-width: 760px) { .screen-detail { grid-template-columns: 1fr; } }
.diagram img { max-width: 100%; border: 1px solid var(--c-border); border-radius: 8px; background: #fff; }
/* ガント */
.gantt { display: grid; grid-template-columns: minmax(220px, 34%) minmax(0, 1fr); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.gantt-row { display: contents; }
.gantt-row > * { border-bottom: 1px solid var(--c-border); min-height: 34px; }
.gantt-name { padding: 6px 10px; font-size: 14px; line-height: 1.4; }
.gantt-name.is-parent { font-weight: 700; background: var(--c-surface-muted); }
.gantt-name .meta { display: block; }
.gantt-track { position: relative; }
.gantt-head { font-size: 12px; color: var(--c-muted); }
.gantt-month { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--c-border); padding-left: 4px; white-space: nowrap; }
.gantt-bar { position: absolute; top: 9px; height: 16px; border-radius: 4px; background: var(--c-bar); overflow: hidden; }
.gantt-bar i { display: block; height: 100%; background: var(--c-bar-done); }
.gantt-ms { position: absolute; top: 9px; width: 14px; height: 14px; background: var(--c-milestone); transform: translateX(-7px) rotate(45deg); }
.gantt-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--c-today); }
