/* スタンドアロンページ全体 */
body.csdocs-standalone {
  margin: 0;
  background: #FDF1EA !important;
}
.csdocs-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
}
.csdocs-page-inner {
  width: 100%;
  max-width: 960px;
}
.csdocs-back {
  display: inline-block;
  font-size: 14px;
  color: #0A0A0A;
  text-decoration: none;
  margin-bottom: 12px;
}
.csdocs-back:hover,
.csdocs-back:focus {
  color: #0F6E56;
}

/* ビューワー起動中はページラッパーを全幅化 */
body.csdocs-viewing .csdocs-page {
  display: block;
  padding: 0;
  min-height: 0;
}
body.csdocs-viewing .csdocs-page-inner {
  max-width: none;
  width: 100%;
}

/* PDFビューワー */
.csdocs-viewer {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--csdocs-header-h, 80px));
}
.csdocs-viewer-topbar {
  position: absolute;
  top: 16px;
  right: 24px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
}
#csdocs-share {
  background: transparent;
  border: 1px solid #0A0A0A;
  border-radius: 999px;
  color: #0A0A0A;
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
}
#csdocs-share:hover,
#csdocs-share:focus {
  border-color: #0F6E56;
  color: #0F6E56;
}
#csdocs-share-msg {
  font-size: 13px;
  color: #0F6E56;
}
.csdocs-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.csdocs-stage canvas {
  display: block;
  position: relative;
  z-index: 1;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(10, 10, 10, 0.20);
}
.csdocs-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 2;
}
.csdocs-zone-prev {
  left: 0;
  cursor: w-resize;
}
.csdocs-zone-next {
  right: 0;
  cursor: e-resize;
}
.csdocs-page-pill {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: #FDF1EA;
  color: #0A0A0A;
  font-size: 14px;
  padding: 6px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(10, 10, 10, 0.18);
}
.csdocs-download {
  position: fixed;
  bottom: 16px;
  right: 24px;
  z-index: 10;
  background: #0F6E56;
  color: #FDF1EA;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 0;
}
.csdocs-download:hover,
.csdocs-download:focus {
  background: #0A0A0A;
  color: #FDF1EA;
}
/* 最終ページ以外では視覚的に非表示。ただしスクリーンリーダーには読まれ、
   キーボードでフォーカスすると可視化される(常時ダウンロード導線を確保)。 */
.csdocs-download.csdocs-visually-hidden:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 資料閲覧前フォーム: 2枚の独立カード */
.csdocs-gate,
.csdocs-gate * {
  box-sizing: border-box;
}
.csdocs-gate {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
  width: 100%;
  margin: 0;
}
@media (max-width: 680px) {
  .csdocs-gate {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* 左カード: 表紙 */
.csdocs-gate-visual {
  padding: 0;
  margin: 0;
  height: 100%;
  min-width: 0;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(10, 10, 10, 0.14);
  overflow: hidden;
  background: #FDF1EA;
}
.csdocs-gate-cover {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.csdocs-gate-fallback {
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0F6E56;
  padding: 32px;
  text-align: center;
}
.csdocs-gate-fallback span {
  color: #FDF1EA;
  font-weight: 900;
  font-size: 22px;
  line-height: 1.6;
}
@media (max-width: 680px) {
  .csdocs-gate-visual {
    height: 220px;
  }
  .csdocs-gate-fallback {
    min-height: 220px;
    height: 220px;
  }
}

/* 右カード: フォーム */
.csdocs-gate-form {
  background: #FDF1EA;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(10, 10, 10, 0.14);
  padding: 48px;
}
@media (max-width: 680px) {
  .csdocs-gate-form {
    padding: 24px;
  }
}
.csdocs-gate-title {
  font-weight: 900;
  font-size: 26px;
  line-height: 1.5;
  color: #0A0A0A;
  margin: 0 0 16px;
}
.csdocs-gate-excerpt {
  font-size: 16px;
  line-height: 1.8;
  color: #0A0A0A;
  margin: 0 0 40px;
}

/* 入力フィールド: アンダーラインスタイル */
.csdocs-field {
  margin: 0 0 28px;
}
.csdocs-field label {
  display: block;
  font-size: 12px;
  letter-spacing: .1em;
  font-weight: 700;
  color: #0A0A0A;
  margin-bottom: 4px;
}
.csdocs-field input {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid #0A0A0A;
  border-radius: 0;
  background: transparent;
  padding: 12px 4px;
  font-size: 16px;
  color: #0A0A0A;
}
.csdocs-field input:focus {
  border-bottom-color: #0F6E56;
  outline: none;
}

/* 同意チェック */
.csdocs-consent {
  margin: 0 0 32px;
}
.csdocs-consent label {
  font-size: 13px;
  line-height: 1.7;
  color: #0A0A0A;
}

/* 送信ボタン */
.csdocs-submit {
  width: 100%;
  background: #0F6E56;
  color: #FDF1EA;
  border: none;
  border-radius: 0;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}
.csdocs-submit:hover,
.csdocs-submit:focus {
  background: #0A0A0A;
}

/* エラー表示 */
.csdocs-field-error {
  display: none;
  font-size: 14px;
  color: #B3261E;
  margin: 4px 0 0;
}
.csdocs-gate input.csdocs-input-error {
  border-bottom-color: #B3261E;
}

/* 相談するボタン(問い合わせモーダルを開く) */
.csdocs-consult {
  background: #0A0A0A;
  border: 1px solid #0A0A0A;
  border-radius: 999px;
  color: #FDF1EA;
  font-size: 13px;
  padding: 8px 16px;
  text-decoration: none;
  margin-right: 8px;
}
.csdocs-consult:hover,
.csdocs-consult:focus {
  background: #0F6E56;
  border-color: #0F6E56;
  color: #FDF1EA;
}
