:root {
  --page-background: #12101a;
  --page-background-accent: #2a1d49;
  --panel-background: rgba(29, 25, 40, 0.92);
  --panel-background-soft: rgba(255, 255, 255, 0.04);
  --border-color: rgba(255, 255, 255, 0.09);
  --text-color: #f5f3ff;
  --muted-text-color: #cfc7e4;
  --accent-color: #8d6bff;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --sidebar-image-width: 48px;
  --sidebar-image-height: 502px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-color);
  font-family: "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif;
  background:
    radial-gradient(circle at top, rgba(141, 107, 255, 0.22), transparent 34%),
    linear-gradient(180deg, var(--page-background-accent), var(--page-background));
}

img {
  max-width: 100%;
}

.page {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.hero {
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #ddd2ff;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
}

.hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.15;
}

.lead {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted-text-color);
  font-size: 0.92rem;
  line-height: 1.6;
}

.layoutCard {
  border: 1px solid var(--border-color);
  border-radius: 24px;
  background: var(--panel-background);
  box-shadow: 0 24px 60px var(--shadow-color);
  backdrop-filter: blur(12px);
  padding: 18px 18px 16px;
}

.documentLayout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.tocPanel {
  position: sticky;
  top: 20px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px 14px;
}

.tocTitle {
  margin: 0 0 10px;
  color: #ddd2ff;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.tocNav {
  display: grid;
  gap: 8px;
}

.tocMainLink {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-color);
  background: rgba(141, 107, 255, 0.14);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
}

.tocGroup {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(141, 107, 255, 0.18);
  border-radius: 16px;
  background: rgba(141, 107, 255, 0.05);
}

.tocSubNav {
  display: grid;
  gap: 6px;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 2px solid rgba(141, 107, 255, 0.26);
}

.tocSubLink {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted-text-color);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  font-size: 0.84rem;
  line-height: 1.4;
}

.tocSubLink::before {
  content: "└ ";
  color: #ddd2ff;
}

.contentPanel {
  min-width: 0;
}

.sectionSpacing {
  margin-top: 20px;
}

.sectionHeader {
  margin-bottom: 16px;
}

.sectionLabel {
  margin: 0 0 4px;
  color: #ddd2ff;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.sectionHeader h2 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.2;
}

.sectionLead {
  margin: 8px 0 0;
  color: var(--muted-text-color);
  font-size: 0.92rem;
  line-height: 1.6;
}

.subsectionNav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.subsectionNav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(141, 107, 255, 0.28);
  border-radius: 999px;
  background: rgba(141, 107, 255, 0.14);
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.3;
}

.subsectionBlock {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(141, 107, 255, 0.22);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(141, 107, 255, 0.12), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.subsectionBlock[id] {
  scroll-margin-top: 20px;
}

.subsectionNav + .subsectionBlock {
  margin-top: 0;
}

.subsectionTitle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.4;
}

.subsectionTitle::before {
  content: "項目";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(141, 107, 255, 0.2);
  color: #ddd2ff;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.importantNotice {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 189, 89, 0.34);
  border-left: 5px solid #ffbd59;
  border-radius: 16px;
  background: rgba(255, 189, 89, 0.1);
}

.importantNoticeTitle {
  margin: 0 0 6px;
  color: #ffd79a;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.importantNoticeText {
  margin: 0;
  color: var(--text-color);
  font-size: 0.96rem;
  line-height: 1.7;
  font-weight: 700;
}

.guideFigure {
  display: grid;
  grid-template-columns: var(--sidebar-image-width) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
}

.wideGuideFigure {
  display: grid;
  gap: 16px;
}

.wideGuideImage {
  position: relative;
  width: min(100%, 720px);
  margin: 0 auto;
}

.wideGuideImage img {
  display: block;
  width: 100%;
  height: auto;
}

#monitor-page-description .guideFigure,
#monitor-page-description .wideGuideFigure {
  margin-top: 24px;
}

#monitor-page-description .guideFigure:first-of-type {
  margin-top: 0;
}

#monitor-page-description .wideGuideImage {
  width: min(100%, 620px);
}

.pokemonSettingFigure {
  margin-top: 16px;
}

.gmailThreadCropStack {
  width: min(100%, 240px);
  display: grid;
  gap: 8px;
}

.gmailThreadCrop {
  position: relative;
  width: 100%;
  height: 118px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background-image: url('./images/gmail_thread.png');
  background-repeat: no-repeat;
  background-size: 100% auto;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.gmailThreadCropTop {
  background-position: top center;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.gmailThreadCropBottom {
  background-position: bottom center;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.gmailThreadOmitMark {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  color: #ddd2ff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.imageCalloutFigure {
  position: relative;
  width: 100%;
}

.imageCalloutOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.imageCalloutLine {
  stroke: #ffbd59;
  stroke-width: 0.75;
  stroke-linecap: round;
}

.imageCalloutArrowHead {
  fill: #ffbd59;
}

.imageCalloutLabel {
  position: absolute;
  left: var(--label-left);
  top: var(--label-top);
  transform: translate(-50%, -50%);
  max-width: 140px;
  padding: 7px 10px;
  border: 2px solid rgba(255, 189, 89, 0.92);
  border-radius: 14px;
  background: rgba(36, 26, 63, 0.96);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.imageCalloutRing {
  position: absolute;
  left: var(--ring-left);
  top: var(--ring-top);
  width: 30px;
  height: 30px;
  border: 3px solid #ffbd59;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 7px rgba(255, 189, 89, 0.14);
  pointer-events: none;
}

.imagePanel {
  width: var(--sidebar-image-width);
}

.imageMarkerFigure {
  position: relative;
  width: var(--sidebar-image-width);
}

.imagePanel img {
  display: block;
  width: var(--sidebar-image-width);
  height: auto;
}

.numberMarker {
  position: absolute;
  left: var(--marker-left);
  top: var(--marker-top);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #6d4cc2;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.caption {
  margin: 8px 0 0;
  color: var(--muted-text-color);
  font-size: 0.74rem;
  line-height: 1.5;
}

.textPanel {
  position: relative;
  min-width: 0;
  min-height: var(--sidebar-image-height);
}

.iconList {
  position: relative;
  height: var(--sidebar-image-height);
  margin: 0;
  padding: 0;
  list-style: none;
}

.iconList li {
  position: absolute;
  top: var(--icon-position);
  left: 0;
  width: 100%;
  padding: 6px 10px 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-50%);
}

.iconList li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -20px;
  width: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  transform: translateY(-50%);
}

.iconList p {
  margin: 0;
  color: var(--muted-text-color);
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: nowrap;
}

.iconList strong {
  color: var(--text-color);
}

.guideNotes {
  min-width: 0;
}

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

.noteList li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-text-color);
  font-size: 0.9rem;
  line-height: 1.55;
}

.noteList p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.noteNumber {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(141, 107, 255, 0.22);
  color: var(--text-color);
  font-size: 0.86rem;
  font-weight: 700;
}

.noteList strong {
  color: var(--text-color);
}

.usageMatrixSection {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.usageMatrixCard {
  display: grid;
  gap: 10px;
}

.usageMatrixTitle {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.usageMatrixWrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.usageMatrixTable {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.usageMatrixTable th,
.usageMatrixTable td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
  line-height: 1.55;
}

.usageMatrixTable thead th {
  color: #ddd2ff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(141, 107, 255, 0.12);
}

.usageMatrixTable tbody th {
  width: 160px;
  color: var(--text-color);
  font-weight: 700;
}

.usageMatrixTable tbody td {
  color: var(--muted-text-color);
}

.usageMatrixTable tbody tr:last-child th,
.usageMatrixTable tbody tr:last-child td {
  border-bottom: none;
}

.usageMark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
}

.usageMarkUsed {
  color: #dfffd8;
  background: rgba(103, 214, 123, 0.22);
}

.usageMarkUnused {
  color: #d8d0ef;
  background: rgba(255, 255, 255, 0.08);
}

.spreadsheetTableWrapper {
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.spreadsheetTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.spreadsheetTable th,
.spreadsheetTable td {
  padding: 6px 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  font-size: clamp(0.5rem, 0.7vw, 0.72rem);
  line-height: 1.2;
}

.spreadsheetTable thead th {
  color: #ddd2ff;
  font-size: clamp(0.46rem, 0.65vw, 0.66rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(141, 107, 255, 0.12);
}

.spreadsheetTable tbody th {
  color: var(--text-color);
  font-weight: 700;
  word-break: keep-all;
  background: rgba(29, 25, 40, 0.94);
}

.spreadsheetTable thead th:first-child {
  word-break: keep-all;
  border-top-left-radius: 16px;
}

.spreadsheetTable thead th:last-child {
  border-top-right-radius: 16px;
}

.spreadsheetTable th:last-child,
.spreadsheetTable td:last-child {
  border-right: none;
}

.spreadsheetTable tbody tr:last-child th,
.spreadsheetTable tbody tr:last-child td {
  border-bottom: none;
}

.spreadsheetTable tbody tr:last-child th:first-child {
  border-bottom-left-radius: 16px;
}

.spreadsheetTable tbody tr:last-child td:last-child {
  border-bottom-right-radius: 16px;
}

.spreadsheetTableCompact th,
.spreadsheetTableCompact td {
  padding: 5px 2px;
  font-size: clamp(0.42rem, 0.6vw, 0.62rem);
  line-height: 1.15;
}

.spreadsheetTableCompact thead th {
  font-size: clamp(0.4rem, 0.56vw, 0.58rem);
}

.pageWide {
  width: calc(100% - 24px);
  max-width: 1500px;
}

.contentPanelWide {
  width: 100%;
}

@media (max-width: 820px) {
  .page {
    width: min(100% - 24px, 1080px);
    padding: 20px 0 32px;
  }

  .documentLayout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tocPanel {
    position: static;
  }

  .guideFigure {
    grid-template-columns: 1fr;
  }

  .wideGuideImage {
    width: 100%;
  }

  .imageCalloutLabel {
    max-width: 132px;
    font-size: 0.7rem;
  }

  .imagePanel {
    margin: 0 auto;
  }

  .caption {
    text-align: center;
  }

  .textPanel {
    min-height: auto;
  }

  .iconList {
    height: auto;
    display: grid;
    gap: 12px;
  }

  .iconList li {
    position: static;
    width: auto;
    padding: 10px 12px;
    transform: none;
  }

  .iconList li::before {
    display: none;
  }

  .iconList p {
    white-space: normal;
  }
}
