:root {
  --bg: #ffffff;
  --surface: #f6f6f4;
  --surface-strong: #efefec;
  --text: #171717;
  --muted: #666663;
  --line: #deded9;
  --line-strong: #c8c8c1;
  --accent: #315b86;
  --accent-soft: #eef3f8;
  --content: 1120px;
  --reading: 760px;
  --radius: 10px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: .015em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-channel="susume"] {
  --accent: #bf2b6f;
  --accent-soft: #faedf3;
}

body[data-channel="lab"] {
  --accent: #6b3ba4;
  --accent-soft: #f2eef7;
}

body[data-channel="ccaa"] {
  --accent: #28577f;
  --accent-soft: #edf3f7;
}

body[data-channel="instagram"] {
  --accent: #bd483f;
  --accent-soft: #faefed;
}

body[data-channel="other"] {
  --accent: #28736d;
  --accent-soft: #edf6f4;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}

.channel-rail {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #fafaf8;
}

.rail-inner {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 100vh;
  max-height: 100vh;
  flex-direction: column;
  padding: 26px 18px 20px;
  overflow-y: auto;
}

.rail-home {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  margin: 0 0 34px 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.rail-home img {
  width: 24px;
  height: 24px;
}

.rail-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-link {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #454542;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}

.rail-link:hover {
  background: #f0f0ed;
  color: var(--text);
}

.rail-link[aria-current="page"] {
  background: #ebebe7;
  color: var(--text);
}

.rail-link[aria-current="page"]::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: -18px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--channel-color, var(--accent));
  content: "";
}

.avatar-shell {
  --channel-color: var(--accent);
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--channel-color);
  font-size: 12px;
  font-weight: 800;
}

.rail-link .avatar-shell {
  width: 32px;
  height: 32px;
  font-size: 10px;
}

.avatar-shell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-shell img.is-broken {
  display: none;
}

.page {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 70px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(28px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}

.wordmark {
  font-size: 15px;
  font-weight: 760;
  letter-spacing: .02em;
  text-decoration: none;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.top-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.top-links a:hover {
  color: var(--text);
}

main,
.footer-inner {
  width: min(var(--content), calc(100% - 96px));
  margin-inline: auto;
}

.hero {
  display: block;
  padding: clamp(72px, 9vw, 124px) 0 clamp(72px, 8vw, 108px);
}

.hero > div {
  max-width: 900px;
}

.hero h1 {
  max-width: 860px;
  margin: 24px 0 24px;
  font-size: clamp(44px, 5.5vw, 72px);
  font-weight: 760;
  letter-spacing: -.055em;
  line-height: 1.18;
}

.home-title span {
  display: block;
}

.lead {
  max-width: var(--reading);
  margin: 0;
  color: #4e4e4a;
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.95;
}

.kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 720;
  letter-spacing: .04em;
}

.hero-channel {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-channel .avatar-shell {
  width: 54px;
  height: 54px;
}

.hero-channel p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 720;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 1px solid var(--text);
  border-radius: 7px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  font-weight: 680;
  text-decoration: none;
}

.button:hover {
  background: #353532;
}

.button.secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--text);
}

.button.secondary:hover {
  background: var(--surface);
}

.section {
  padding: 78px 0 88px;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(200px, 290px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-bottom: 44px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 740;
  letter-spacing: -.035em;
  line-height: 1.35;
}

.section-head p {
  max-width: 700px;
  margin: 2px 0 0;
  color: var(--muted);
  line-height: 1.9;
}

.channel-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.channel-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 184px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-decoration: none;
}

.channel-row:hover {
  border-color: var(--line-strong);
  background: #fbfbfa;
}

.channel-row .avatar-shell {
  align-self: start;
}

.channel-row h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -.01em;
}

.channel-row div p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.channel-row > p {
  grid-column: 2 / -1;
  align-self: start;
  margin: -4px 0 0;
  color: #52524f;
  font-size: 14px;
  line-height: 1.8;
}

.row-action {
  display: none;
}

.workflow-line {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 0 0 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.workflow-step {
  min-height: 112px;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
}

.workflow-step:last-child {
  border-right: 0;
}

.workflow-step strong,
.workflow-step span {
  display: block;
}

.workflow-step strong {
  margin-bottom: 8px;
  font-size: 14px;
}

.workflow-step span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.rule-section {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 48px;
  padding: 38px 0 42px;
  border-top: 1px solid var(--line);
}

.rule-section:last-child {
  border-bottom: 1px solid var(--line);
}

.rule-section h3 {
  position: relative;
  margin: 0;
  padding-left: 14px;
  font-size: 18px;
  font-weight: 720;
  line-height: 1.5;
}

.rule-section h3::before {
  position: absolute;
  top: .35em;
  bottom: .35em;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}

.rule-body {
  min-width: 0;
  max-width: 820px;
}

.rule-body > :first-child {
  margin-top: 0;
}

.rule-body > :last-child {
  margin-bottom: 0;
}

.rule-body p,
.rule-body li,
.section > p {
  color: #444441;
}

.rule-body ul,
.rule-body ol {
  margin: 18px 0;
  padding-left: 1.4em;
}

.rule-body li + li {
  margin-top: 8px;
}

.format-table {
  display: block;
  width: 100%;
  margin: 22px 0;
  border-collapse: collapse;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.format-table thead,
.format-table tbody {
  display: table;
  width: 100%;
  min-width: 620px;
  table-layout: fixed;
}

.format-table th,
.format-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.format-table th {
  background: var(--surface);
  color: #4c4c49;
  font-size: 12px;
  font-weight: 720;
}

.format-table td {
  color: #3f3f3c;
  font-size: 14px;
  line-height: 1.75;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.check-item {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.check-item:nth-child(odd) {
  padding-right: 28px;
}

.check-item:nth-child(even) {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.check-item strong {
  font-size: 14px;
}

.check-item span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.callout {
  margin: 26px 0;
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
}

.callout p {
  margin: 0;
  color: #3f3f3c;
}

.callout.warning {
  border-left-color: #777773;
  background: #f3f3f1;
}

.command-box {
  position: relative;
  margin: 24px 0;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-x: auto;
}

.command-box code {
  display: block;
  min-width: max-content;
  padding-right: 90px;
  color: #292927;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.copy-button {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #333330;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.copy-button:hover {
  background: #ecece9;
}

.footer {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  min-height: 128px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  color: var(--muted);
  font-size: 12px;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  color: var(--text);
}

.no-break {
  white-space: nowrap;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .rail-link {
    font-size: 12px;
  }

  main,
  .footer-inner {
    width: min(var(--content), calc(100% - 64px));
  }

  .workflow-line {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .workflow-step:nth-child(4) {
    border-right: 0;
  }

  .workflow-step:nth-child(-n+4) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 780px) {
  .app-shell {
    display: block;
  }

  .channel-rail {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(250, 250, 248, .97);
    backdrop-filter: blur(12px);
  }

  .rail-inner {
    position: static;
    min-height: 0;
    max-height: none;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .rail-inner::-webkit-scrollbar {
    display: none;
  }

  .rail-home {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    margin: 0;
  }

  .rail-home img {
    width: 21px;
    height: 21px;
  }

  .rail-list {
    display: flex;
    gap: 4px;
  }

  .rail-link {
    grid-template-columns: 28px auto;
    min-height: 42px;
    width: max-content;
    padding: 5px 9px;
  }

  .rail-link .avatar-shell {
    width: 28px;
    height: 28px;
  }

  .rail-link[aria-current="page"]::before {
    top: auto;
    right: 10px;
    bottom: -10px;
    left: 10px;
    width: auto;
    height: 2px;
    border-radius: 2px 2px 0 0;
  }

  .topbar {
    position: static;
    height: 62px;
    padding: 0 22px;
  }

  .top-links {
    gap: 16px;
  }

  main,
  .footer-inner {
    width: calc(100% - 40px);
  }

  .hero {
    padding: 58px 0 68px;
  }

  .hero h1 {
    margin-top: 20px;
    font-size: clamp(40px, 12vw, 56px);
  }

  .lead {
    font-size: 16px;
    line-height: 1.9;
  }

  .section {
    padding: 58px 0 66px;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
  }

  .channel-index,
  .checklist {
    grid-template-columns: 1fr;
  }

  .channel-row {
    min-height: 0;
    padding: 22px;
  }

  .workflow-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 64px;
  }

  .workflow-step,
  .workflow-step:nth-child(4) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .workflow-step:nth-child(even) {
    border-right: 0;
  }

  .workflow-step:last-child {
    border-bottom: 0;
  }

  .rule-section {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 30px 0 34px;
  }

  .check-item,
  .check-item:nth-child(odd),
  .check-item:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 20px 0;
    border-left: 0;
  }

  .footer-inner {
    min-height: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 38px 0;
  }
}

@media (max-width: 520px) {
  .top-links a:first-child {
    display: none;
  }

  .channel-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
  }

  .channel-row .row-action {
    display: none;
  }

  .channel-row > p {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .command-box {
    padding: 22px 18px;
  }

  .command-box code {
    padding-top: 34px;
    padding-right: 0;
  }
}

@media print {
  .channel-rail,
  .topbar,
  .hero-actions,
  .copy-button,
  .footer {
    display: none;
  }

  .app-shell {
    display: block;
  }

  main {
    width: 100%;
  }
}
