/* ==========================================================================
   LP STUDIO 操作マニュアル — shared stylesheet
   Plain CSS, no build step. Every page links this one file.
   Colours are tokens on :root; each manual swaps only the accent
   (tenant = teal like the tenant editor, admin = blue like the HQ console).
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-sunk: #eef0f3;
  --text: #1c1f24;
  --text-2: #464d5a;
  --text-3: #636b78;
  --line: #e2e5ea;
  --line-strong: #c9ced6;

  --accent: #0f766e;
  --accent-strong: #0b5c55;
  --accent-soft: #e7f4f2;
  --accent-line: #b5dcd6;

  --ok: #15803d;      --ok-soft: #eaf6ee;
  --info: #1d4ed8;    --info-soft: #eaf0fd;
  --warn: #a15c07;    --warn-soft: #fdf4e3;
  --danger: #b91c1c;  --danger-soft: #fdeceb;
  --mark: #fde68a;

  --radius: 10px;
  --radius-sm: 6px;
  --header-h: 60px;
  --sidebar-w: 290px;
  --content-w: 820px;

  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
          "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  color-scheme: light;
}

body[data-audience="admin"] {
  --accent: #1d4ed8;
  --accent-strong: #1e3a8a;
  --accent-soft: #eaf0fd;
  --accent-line: #bccdf6;
}

/* ── Base ─────────────────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

img { max-width: 100%; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.5em; }
li { margin: .25em 0; }
li > ul, li > ol { margin: .35em 0 .5em; }

strong, b { font-weight: 700; }

code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .05em .4em;
  word-break: break-all;
}

hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 8px; color: #fff; }

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

/* ── Header ───────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(6px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: .06em; }
.brand-sub {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audience-badge {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.header-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.header-links a:hover { background: var(--bg-soft); color: var(--text); }

.toc-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.toc-toggle svg { width: 18px; height: 18px; }

/* ── Layout (manual pages) ───────────────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 14px 40px 20px;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}

.content {
  width: 100%;
  max-width: calc(var(--content-w) + 96px);
  margin: 0 auto;
  padding: 40px 48px 120px;
}

.backdrop {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 30;
  background: rgba(20, 24, 31, .45);
}

/* ── Search ───────────────────────────────────────────────────────────── */

.search { position: relative; margin-bottom: 18px; }

.search-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}

.search-box { position: relative; }
.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 40px 10px 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.search-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.search-clear {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.search-clear[hidden] { display: none; }
.search-clear:hover { color: var(--text); }

.search-hint { font-size: 12px; color: var(--text-3); margin: 6px 2px 0; line-height: 1.6; }

.search-results {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}
.search-results[hidden] { display: none; }
.search-count {
  font-size: 12px;
  color: var(--text-3);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.search-results ol { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.search-results li { margin: 0; border-bottom: 1px solid var(--line); }
.search-results li:last-child { border-bottom: 0; }
.search-results a {
  display: block;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.6;
}
.search-results a:hover, .search-results a:focus-visible { background: var(--accent-soft); outline: none; }
.sr-title { display: block; font-weight: 700; font-size: 14px; }
.sr-where { display: block; font-size: 12px; color: var(--text-3); }
.sr-snippet { display: block; font-size: 13px; color: var(--text-2); margin-top: 2px; }
.search-empty { padding: 12px; font-size: 13px; color: var(--text-2); line-height: 1.7; }

mark {
  background: var(--mark);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
mark.hit { transition: background-color 1.2s ease; }
mark.hit.faded { background: transparent; }

/* ── Table of contents ────────────────────────────────────────────────── */

.toc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  margin: 4px 2px 8px;
}

.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }

.toc a {
  display: flex;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
  text-decoration: none;
}
.toc a:hover { background: var(--bg-sunk); color: var(--text); }

.toc .toc-num {
  flex: none;
  min-width: 1.6em;
  font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.toc > ol > li > a { font-weight: 700; color: var(--text); }
.toc > ol > li.is-current > a { color: var(--accent-strong); }
.toc > ol > li.is-current > a .toc-num { color: var(--accent); }

.toc li ol { display: none; margin: 2px 0 8px 18px; padding-left: 10px; border-left: 2px solid var(--line); }
.toc li.is-current ol { display: block; }
.toc li ol a { font-size: 13.5px; padding: 5px 10px; }
.toc a.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

/* ── Page title & chapter headings ────────────────────────────────────── */

.page-head { margin-bottom: 40px; }
.page-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .08em;
  margin-bottom: 6px;
}
.page-head h1 {
  font-size: 30px;
  line-height: 1.45;
  margin: 0 0 12px;
  letter-spacing: .03em;
}
.page-head .lead { font-size: 17px; color: var(--text-2); margin: 0; }

.chapter { padding-top: 8px; margin-top: 72px; }
.chapter:first-of-type { margin-top: 0; }

.chapter > h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 25px;
  line-height: 1.45;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line);
}
.chapter > h2 .num {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.sub { margin-top: 48px; }

.sub > h3 {
  font-size: 20px;
  line-height: 1.5;
  margin: 0 0 16px;
  padding: 2px 0 2px 14px;
  border-left: 5px solid var(--accent);
}
.sub > h3 .num { color: var(--text-3); font-size: 15px; margin-right: 8px; font-weight: 700; }

h4 {
  font-size: 17px;
  line-height: 1.55;
  margin: 32px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
h4::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

.anchor {
  margin-left: auto;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 16px;
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity .15s;
}
.sub > h3 .anchor { margin-left: 8px; display: inline-grid; vertical-align: middle; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { background: var(--bg-sunk); color: var(--text); }

/* ── Inline pieces ────────────────────────────────────────────────────── */

/* A button or tab exactly as it is labelled on screen. */
.ui {
  display: inline-block;
  margin: 0 .15em;
  padding: 0 .55em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: .92em;
  font-weight: 700;
  line-height: 1.65;
  white-space: nowrap;
  vertical-align: .05em;
}
.ui.primary { background: var(--accent); border-color: var(--accent-strong); color: #fff; }
.ui.danger { border-color: #e7a9a9; color: var(--danger); }

/* A screen or field name (not a button). */
.label { font-weight: 700; color: var(--text); }
.label::before { content: "「"; font-weight: 400; color: var(--text-3); }
.label::after { content: "」"; font-weight: 400; color: var(--text-3); }

/* Menu path: 加盟店管理 › 加盟店追加 */
.path { font-weight: 700; }
.path > span + span::before {
  content: "›";
  margin: 0 .4em;
  color: var(--text-3);
  font-weight: 400;
}

.req, .opt {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
  vertical-align: .1em;
  white-space: nowrap;
}
.req { background: var(--danger); color: #fff; }
.opt { background: var(--bg-sunk); color: var(--text-3); border: 1px solid var(--line); }

.tag {
  display: inline-block;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.8;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tag.gray { background: var(--bg-sunk); color: var(--text-2); border-color: var(--line); }
.tag.green { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cb; }
.tag.blue { background: var(--info-soft); color: var(--info); border-color: #c5d4f6; }
.tag.orange { background: var(--warn-soft); color: var(--warn); border-color: #f0d6a8; }
.tag.red { background: var(--danger-soft); color: var(--danger); border-color: #f1c3c0; }

.muted { color: var(--text-3); }
.small { font-size: 14px; }

/* ── Blocks ───────────────────────────────────────────────────────────── */

.summary {
  margin: 0 0 28px;
  padding: 18px 22px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.summary-title {
  font-weight: 700;
  color: var(--accent-strong);
  margin: 0 0 6px;
  font-size: 15px;
}
.summary ul { margin: 0; padding-left: 0; list-style: none; }
.summary li { position: relative; padding-left: 26px; }
.summary li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .62em;
  width: 11px;
  height: 6px;
  border-left: 2.5px solid var(--accent);
  border-bottom: 2.5px solid var(--accent);
  transform: rotate(-45deg);
}

.note {
  position: relative;
  margin: 18px 0 24px;
  padding: 14px 18px 14px 54px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left-width: 5px;
  background: var(--bg-soft);
}
.note::before {
  position: absolute;
  left: 16px;
  top: 15px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.note > :last-child { margin-bottom: 0; }
.note-title { font-weight: 700; margin: 0 0 4px; }
.note ul, .note ol { margin-bottom: .4em; }

.note.tip { border-color: #bfe3cb; border-left-color: var(--ok); background: var(--ok-soft); }
.note.tip::before { content: "✓"; background: var(--ok); }
.note.tip .note-title { color: var(--ok); }

.note.info { border-color: #c5d4f6; border-left-color: var(--info); background: var(--info-soft); }
.note.info::before { content: "i"; background: var(--info); font-family: Georgia, serif; font-style: italic; }
.note.info .note-title { color: var(--info); }

.note.warn { border-color: #f0d6a8; border-left-color: var(--warn); background: var(--warn-soft); }
.note.warn::before { content: "!"; background: var(--warn); }
.note.warn .note-title { color: var(--warn); }

.note.danger { border-color: #f1c3c0; border-left-color: var(--danger); background: var(--danger-soft); }
.note.danger::before { content: "!"; background: var(--danger); }
.note.danger .note-title { color: var(--danger); }

/* Numbered procedure */
ol.steps {
  list-style: none;
  counter-reset: step;
  margin: 18px 0 26px;
  padding: 0;
}
ol.steps > li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 3px 0 22px 52px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
ol.steps > li::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 40px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}
ol.steps > li:last-child { padding-bottom: 4px; }
ol.steps > li:last-child::after { display: none; }
ol.steps > li > p:last-child { margin-bottom: 0; }
ol.steps .shot { margin-bottom: 8px; }

/* Plain tables */
.table-wrap {
  margin: 16px 0 26px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.7;
}
th, td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
thead th {
  background: var(--bg-soft);
  font-size: 13.5px;
  color: var(--text-2);
  white-space: nowrap;
}
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 700; background: #fcfcfd; min-width: 9em; }
td.nowrap, th.nowrap { white-space: nowrap; }
table .req, table .opt { margin-left: 4px; }

/* Screen parts: "where / what it does" */
.parts { display: grid; gap: 10px; margin: 16px 0 26px; padding: 0; list-style: none; }
.parts > li {
  display: grid;
  grid-template-columns: 11em minmax(0, 1fr);
  gap: 4px 16px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.parts .part-name { font-weight: 700; }
.parts .part-desc > :last-child { margin-bottom: 0; }

/* Flow of the whole job */
.flow {
  list-style: none;
  counter-reset: flow;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 26px;
  margin: 18px 0 28px;
  padding: 0;
}
.flow > li {
  counter-increment: flow;
  position: relative;
  margin: 0;
  padding: 16px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.flow > li::before {
  content: counter(flow);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 14px;
}
.flow > li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -19px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-top: 2.5px solid var(--line-strong);
  border-right: 2.5px solid var(--line-strong);
  transform: translateY(-50%) rotate(45deg);
}
.flow b { display: block; font-size: 15px; line-height: 1.5; margin-bottom: 4px; }
.flow small { display: block; font-size: 13px; color: var(--text-2); line-height: 1.65; }
.flow a { font-size: 13px; font-weight: 700; }
/* Five steps in one row (the company profile wizard). Phones keep the stacked layout below. */
@media (min-width: 721px) {
  .flow.compact { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 20px; }
  .flow.compact > li { padding: 14px 12px 12px; }
  .flow.compact > li:not(:last-child)::after { right: -16px; }
}

/* FAQ */
details.faq {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
details.faq > summary {
  position: relative;
  display: block;
  list-style: none;
  min-height: 48px;
  padding: 12px 48px 12px 52px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.6;
}
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::before {
  content: "Q";
  position: absolute;
  left: 14px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
}
details.faq > summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 20px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform .15s;
}
details.faq[open] > summary::after { transform: rotate(-135deg); top: 24px; }
details.faq > summary:hover { background: var(--bg-soft); border-radius: var(--radius); }
.faq-body {
  position: relative;
  padding: 2px 20px 14px 52px;
}
.faq-body::before {
  content: "A";
  position: absolute;
  left: 14px;
  top: 2px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-sunk);
  color: var(--text-2);
  font-weight: 700;
  font-size: 14px;
}
.faq-body > :last-child { margin-bottom: 0; }
.faq-group { font-size: 15px; color: var(--text-2); margin: 28px 0 8px; }

/* Glossary */
dl.glossary { margin: 16px 0 24px; }
dl.glossary > div {
  display: grid;
  grid-template-columns: 11em minmax(0, 1fr);
  gap: 4px 18px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}
dl.glossary dt { font-weight: 700; color: var(--accent-strong); }
dl.glossary dd { margin: 0; }

/* Contact box */
.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin: 24px 0;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.contact-title { font-weight: 700; margin: 0; }
.contact-tel { font-size: 22px; font-weight: 700; letter-spacing: .04em; text-decoration: none; color: var(--text); }
.contact-tel:hover { color: var(--accent-strong); }
.contact p { margin: 0; }

/* ── Screenshots ──────────────────────────────────────────────────────── */

.shot { margin: 18px 0 30px; }
.shot.narrow { max-width: 560px; }
.shot.tiny { max-width: 400px; }

.shot-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}

.shot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: 16 / 9;
  padding: 22px;
  text-align: center;
  color: var(--text-3);
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(16, 24, 40, .025) 14px 28px),
    var(--bg-soft);
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
}
.shot-placeholder svg { width: 40px; height: 40px; color: var(--line-strong); }
.ph-title { font-weight: 700; color: var(--text-2); font-size: 15px; }
.ph-path code { font-size: 13px; background: #fff; }
.ph-memo { max-width: 34em; font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.ph-memo::before { content: "撮影メモ："; font-weight: 700; }

.shot[data-state="missing"] .shot-frame { border: 0; box-shadow: none; background: none; overflow: visible; }

.shot figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}
.shot figcaption::before { content: "▲ "; color: var(--text-3); font-size: 11px; }

.shot-memo { display: none; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 20px 24px;
  background: rgba(12, 14, 18, .88);
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(1400px, 100%);
  max-height: calc(100vh - 130px);
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  cursor: zoom-out;
}
.lightbox-caption { color: #e8eaee; font-size: 14px; text-align: center; }
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

/* Screenshot checklist (open a page with ?shots) */
.shot-check {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  width: min(460px, calc(100vw - 32px));
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 40px rgba(16, 24, 40, .18);
  font-size: 13px;
}
.shot-check-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.shot-check-head button {
  margin-left: auto;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  cursor: pointer;
}
.shot-check ol { margin: 0; padding: 6px 0; overflow-y: auto; list-style: none; }
.shot-check li { margin: 0; }
.shot-check a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 6px;
  padding: 5px 12px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.5;
}
.shot-check a:hover { background: var(--bg-soft); }
.shot-check .st-ok { color: var(--ok); font-weight: 700; }
.shot-check .st-missing { color: var(--danger); font-weight: 700; }
.shot-check code { font-size: 12px; }

/* ── Back to top ──────────────────────────────────────────────────────── */

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 35;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(16, 24, 40, .12);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; }

/* ── Chapter footer navigation ────────────────────────────────────────── */

.page-foot {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--text-3);
}
.page-foot a { font-weight: 700; }

/* ── Top page ─────────────────────────────────────────────────────────── */

.home { max-width: 1040px; margin: 0 auto; padding: 48px 24px 100px; }

.hero { margin-bottom: 44px; }
.hero h1 { font-size: 34px; line-height: 1.4; margin: 0 0 14px; letter-spacing: .04em; }
.hero .lead { font-size: 17px; color: var(--text-2); max-width: 44em; margin: 0; }

.choose {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 56px;
}
.choose-card {
  display: flex;
  flex-direction: column;
  padding: 26px 26px 22px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--c);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .05);
  transition: box-shadow .15s, transform .15s;
}
.choose-card:hover {
  color: var(--text);
  box-shadow: 0 10px 30px rgba(16, 24, 40, .10);
  transform: translateY(-2px);
}
.choose-card.tenant { --c: #0f766e; --c-soft: #e7f4f2; }
.choose-card.admin { --c: #1d4ed8; --c-soft: #eaf0fd; }
.choose-who {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 700;
  color: var(--c);
  background: var(--c-soft);
  border-radius: 999px;
  padding: 2px 12px;
  margin-bottom: 12px;
}
.choose-card h2 { font-size: 22px; line-height: 1.45; margin: 0 0 8px; }
.choose-card p { color: var(--text-2); margin: 0 0 14px; }
.choose-card ul { margin: 0 0 18px; padding-left: 1.2em; color: var(--text-2); font-size: 15px; }
.choose-go {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--c);
}

.home h2.section-title {
  font-size: 22px;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.home .section-lead { color: var(--text-2); margin: 0 0 18px; }
.home section { margin-bottom: 56px; }

.tasks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.task-col h3 {
  font-size: 16px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--c);
  color: var(--c);
}
.task-col.tenant { --c: #0f766e; }
.task-col.admin { --c: #1d4ed8; }
.task-col ul { list-style: none; margin: 0; padding: 0; }
.task-col li { margin: 0; border-bottom: 1px solid var(--line); }
.task-col a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 6px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.task-col a::after {
  content: "";
  margin-left: auto;
  flex: none;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--text-3);
  border-right: 2px solid var(--text-3);
  transform: rotate(45deg);
}
.task-col a:hover { background: var(--bg-soft); color: var(--c); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .content { padding: 36px 32px 120px; }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }

  .toc-toggle { display: inline-flex; }
  .header-links .hide-narrow { display: none; }

  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 35;
    width: min(340px, 88vw);
    height: auto;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 8px 0 30px rgba(16, 24, 40, .15);
    background: #fff;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; }
  body.nav-open { overflow: hidden; }
}

@media (max-width: 720px) {
  .site-header { padding: 0 12px; gap: 8px; }
  .brand-sub { display: none; }
  .audience-badge { display: none; }
  .header-links a { padding: 0 8px; }

  .content { padding: 28px 16px 110px; }
  .page-head h1 { font-size: 25px; }
  .chapter { margin-top: 56px; }
  .chapter > h2 { font-size: 21px; }
  .chapter > h2 .num { min-width: 34px; height: 34px; font-size: 16px; }
  .sub > h3 { font-size: 18px; }

  .parts > li { grid-template-columns: minmax(0, 1fr); }
  dl.glossary > div { grid-template-columns: minmax(0, 1fr); }

  .flow { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .flow > li:not(:last-child)::after {
    right: auto;
    left: 26px;
    top: auto;
    bottom: -17px;
    transform: rotate(135deg);
  }

  .home { padding: 32px 16px 80px; }
  .hero h1 { font-size: 26px; }
  .choose, .tasks { grid-template-columns: minmax(0, 1fr); }

  .note { padding: 12px 14px 12px 48px; }
  .note::before { left: 13px; top: 13px; }
  ol.steps > li { padding-left: 46px; }

  th, td { padding: 9px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

/* ── Print ────────────────────────────────────────────────────────────── */

@media print {
  :root { --header-h: 0px; }
  body { font-size: 11pt; line-height: 1.7; }
  .site-header, .sidebar, .backdrop, .to-top, .anchor, .skip-link,
  .shot-check, .lightbox, .toc-toggle { display: none !important; }
  .layout { display: block; }
  .content { max-width: none; padding: 0; }
  .chapter { break-before: page; margin-top: 0; }
  .chapter:first-of-type { break-before: auto; }
  .sub { margin-top: 32px; }
  h2, h3, h4, .faq-group { break-after: avoid; }
  .note, .shot, .summary, details.faq, .parts > li, tr, ol.steps > li { break-inside: avoid; }
  .flow { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
  .flow > li:not(:last-child)::after { right: -15px; }
  a { color: inherit; text-decoration: none; }
  .shot-frame { box-shadow: none; }
  .shot-placeholder { aspect-ratio: auto; min-height: 120px; }
  .choose-card, .flow > li { box-shadow: none; }
}
