:root {
  --bg: #f6f6f6;
  --title: #727272;
  --text: #727272;
  --sub: #747474;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: none;
}

*::-webkit-scrollbar,
.svg-defs,
.hidden-file-input {
  display: none;
}

::selection {
  background-color: var(--sub);
  color: var(--bg);
}

body {
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button,
input,
a {
  font-family: inherit;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  background: transparent;
  border: none;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.module-error-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background-color: #fee2e2;
  color: #991b1b;
  border-bottom: 2px solid #ef4444;
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.5;
}

.app-container {
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2;
  background-color: var(--bg);
}

/* ==================== 1. ヘッダー＆常設検索バー ==================== */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background-color: var(--bg);
  padding-top: var(--sat);
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 680px;
  height: 58px;
  margin: 0 auto;
  padding: 0 16px;
}

.brand-logo {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--title);
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
}

.header-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-icon-btn,
.header-avatar-btn,
.menu-close-btn,
.modal-top-close-btn {
  width: 44px;
  height: 44px;
  color: var(--text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.header-icon-btn {
  background-color: #ffffff;
}

.header-avatar-btn {
  background-color: #ffffff;
  padding: 3px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  cursor: pointer;
}

.header-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.header-icon-btn:hover,
.legal-back-link:hover {
  background-color: #f7f7f8;
}

.header-icon-btn:active,
.menu-close-btn:active,
.modal-top-close-btn:active {
  transform: scale(0.92);
}

.google-icon {
  width: 26px;
  height: 26px;
  display: block;
}

.modal-top-close-btn {
  position: absolute;
  top: calc(12px + var(--sat));
  left: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
}

.menu-close-btn:hover,
.modal-top-close-btn:hover {
  opacity: 0.6;
}

.header-search-bar-row {
  width: 100%;
  padding: 0 16px 14px;
}

.header-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 680px;
  height: 44px;
  margin: 0 auto;
  background-color: #ffffff;
  border-radius: 9999px;
  padding: 0 16px;
}

.search-input-icon {
  color: var(--sub);
  flex-shrink: 0;
}

.header-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--text);
}

.header-search-input::placeholder {
  color: var(--sub);
}

.search-clear-btn {
  color: var(--sub);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.search-clear-btn:hover {
  color: var(--text);
}

.search-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  width: 100%;
  text-align: center;
  gap: 8px;
}

.search-empty-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.search-empty-sub {
  font-size: 0.82rem;
  color: var(--sub);
}

/* ==================== 2. 全画面メニューシート ==================== */
.menu-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 120;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(6px + var(--sat)) 24px calc(20px + var(--sab));
  overflow-y: auto;
}

.menu-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 480px;
  height: 42px;
  flex-shrink: 0;
}

.menu-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--title);
  letter-spacing: -0.01em;
}

.menu-top-spacer {
  width: 40px;
}

.menu-user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  padding: 14px 16px;
  background-color: #ffffff;
  border-radius: 16px;
  margin-top: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.menu-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.menu-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.menu-user-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.05em;
}

.menu-user-email {
  font-size: 0.78rem;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.05em;
}

.menu-info-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--text-sub);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.menu-info-toggle-btn:hover {
  color: var(--text);
  background-color: rgba(0, 0, 0, 0.05);
}

.menu-info-toggle-btn:active {
  transform: scale(0.9);
}

.menu-button-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 480px;
  margin: 24px 0 auto;
}

.menu-stack-btn {
  width: 100%;
  height: 56px;
  background-color: #ffffff;
  color: var(--text);
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.menu-stack-btn:hover {
  opacity: 0.9;
}

.menu-stack-btn:active {
  transform: scale(0.985);
}

.menu-bottom-footer,
.main-bottom-footer {
  width: 100%;
  max-width: 680px;
  text-align: center;
  padding: 24px 0 10px;
  flex-shrink: 0;
  margin-top: auto;
}

.main-bottom-footer {
  padding: 36px 0 8px;
}

.stripe-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.stripe-badge-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: 0.02em;
}

.stripe-badge-logo {
  height: 22px;
  width: 53px;
  color: #635bff;
  display: block;
}

.menu-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px 6px;
  font-size: 0.64rem;
  color: var(--sub);
  line-height: 1.5;
  padding: 0 16px;
  letter-spacing: -0.01em;
}

.menu-footer-links a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.menu-footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.menu-footer-links .sep {
  opacity: 0.4;
  user-select: none;
}

/* ==================== 3. スクロール領域＆カード一覧 ==================== */
.screen-scroll-container {
  flex: 1;
  width: 100%;
  min-height: 100%;
  overflow-y: auto;
  padding: calc(130px + var(--sat)) 24px calc(40px + var(--sab));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sign-grid,
.creator-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.creator-card,
.sign-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: transparent;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.creator-card-cover,
.sign-card-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.creator-card-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.24) 0%, transparent 100%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: none;
}

.sign-card-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(24, 24, 27, 0.78);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.creator-card-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.sign-card-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.sign-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}

.sign-card-stock {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  flex-shrink: 0;
}

.sign-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.sign-card-price {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.sign-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 26px;
  background-color: #ffffff;
  border-radius: 9999px;
  color: #1a1a1a;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.sign-buy-btn:hover {
  opacity: 0.9;
}

.sign-buy-btn:active {
  transform: scale(0.95);
}

.sign-buy-btn.owned {
  background-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

@media (min-width: 600px) {
  .sign-grid,
  .creator-grid {
    gap: 16px;
  }
  .creator-card,
  .sign-card {
    border-radius: 18px;
  }
  .creator-card-footer {
    padding: 8px 12px;
  }
  .creator-card-name {
    font-size: 0.95rem;
  }
  .sign-card-footer {
    padding: 10px 12px;
    gap: 8px;
  }
  .sign-card-title {
    font-size: 0.9rem;
  }
  .sign-card-stock {
    font-size: 0.72rem;
  }
  .sign-card-price {
    font-size: 1rem;
  }
  .sign-buy-btn {
    height: 30px;
    padding: 0 14px;
    font-size: 0.78rem;
  }
}

/* ==================== 4. フルスクリーンモーダル＆出品フォーム ==================== */
.full-screen-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  padding: calc(14px + var(--sat)) 20px calc(24px + var(--sab));
  overflow-y: auto;
}

.full-screen-header {
  text-align: center;
  padding: 4px 0 8px;
  margin-bottom: 8px;
}

.full-screen-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--title);
}

.full-screen-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: 28px;
}

.notice-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--sub);
  text-align: center;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sub);
}

.sign-uploader-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 4px 0 16px;
}

.sign-upload-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #ffffff;
  border: 2px dashed #dcdce0;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.sign-upload-box:hover,
.sign-upload-box.dragover {
  border-color: var(--text);
  background-color: #fafafc;
}

.sign-upload-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
}

.sign-upload-plus-icon {
  width: 52px;
  height: 52px;
  color: #a0a0a8;
  transition: transform 0.15s ease, color 0.15s ease;
}

.sign-upload-hint-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #8e8e93;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}

.sign-upload-box:hover .sign-upload-plus-icon {
  color: var(--text);
  transform: scale(1.08);
}

.sign-upload-box:hover .sign-upload-hint-text {
  color: var(--text);
}

.sign-upload-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #ffffff;
  padding: 10px;
}

.sign-upload-change-hint {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sub);
  padding: 4px 10px;
  transition: color 0.15s ease;
}

.sign-upload-change-hint:hover {
  color: var(--text);
}

.file-picker-box {
  width: 100%;
  height: 50px;
  background-color: #ffffff;
  border-radius: 14px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.file-picker-box:hover {
  opacity: 0.9;
}

.file-picker-icon {
  color: var(--sub);
  flex-shrink: 0;
}

.file-picker-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-picker-label.selected {
  color: var(--text);
  font-weight: 700;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.box-input {
  width: 100%;
  height: 50px;
  background-color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 0 16px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.box-select {
  width: 100%;
  height: 50px;
  background-color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 0 16px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.accordion-select-box {
  width: 100%;
  background-color: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.accordion-select-box.open {
  border: 1.5px solid #e8e8ea;
}

.accordion-select-trigger {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
}

.accordion-select-arrow {
  color: var(--sub);
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.accordion-select-arrow.open {
  transform: rotate(180deg);
}

.accordion-select-body {
  border-top: 1px solid #f0f0f2;
}

.accordion-select-item {
  width: 100%;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease;
}

.accordion-select-item:hover,
.accordion-select-item:active {
  background-color: #f7f7f8;
}

.accordion-select-item.selected {
  background-color: #f0f2f5;
  color: var(--title);
  font-weight: 700;
}

.box-textarea {
  width: 100%;
  min-height: 220px;
  background-color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 16px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.6;
  resize: vertical;
}

.box-textarea::placeholder {
  color: var(--sub);
  opacity: 0.65;
}

.contact-complete-box {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.contact-complete-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: #e8f8f0;
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.contact-complete-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--title);
}

.contact-complete-desc {
  font-size: 0.88rem;
  color: var(--sub);
  line-height: 1.6;
}

.contact-public-note {
  margin-top: 18px;
  padding: 14px 16px;
  background-color: #f7f7f8;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--sub);
  line-height: 1.5;
  text-align: center;
}

.contact-public-link {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.contact-public-link:hover {
  opacity: 0.75;
}

.box-input::-webkit-outer-spin-button,
.box-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.box-input[type="number"] {
  -moz-appearance: textfield;
}

.box-input::placeholder {
  color: var(--sub);
  opacity: 0.65;
}

.modal-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.upload-limit-notice {
  text-align: center;
  font-size: 0.82rem;
  color: var(--sub);
  margin-top: 6px;
  line-height: 1.5;
  font-weight: 600;
}

.modal-btn-cancel,
.modal-btn-submit {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.modal-btn-submit {
  background: var(--text);
  color: var(--bg);
}

.modal-btn-submit:hover {
  opacity: 0.9;
}

.modal-btn-cancel {
  background: #ffffff;
  color: var(--text);
}

.modal-btn-cancel:hover {
  opacity: 0.85;
}

.modal-btn-submit:active,
.modal-btn-cancel:active {
  transform: scale(0.985);
}

/* ==================== 5. 購入完了フルスクリーン演出 ==================== */
.purchase-complete-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  padding: calc(24px + var(--sat)) 24px calc(36px + var(--sab));
}

.purchase-complete-brand {
  position: absolute;
  top: calc(20px + var(--sat));
  left: 24px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--title);
}

.purchase-complete-content {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.purchase-complete-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--title);
}

.purchase-complete-kaomoji {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sub);
}

.purchase-complete-badge-showcase {
  margin: 12px 0;
  width: 240px;
  aspect-ratio: 10 / 7;
  border-radius: 16px;
  border: 2px solid var(--sub);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.purchase-complete-badge-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.purchase-complete-badge-label {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--title);
}

.purchase-complete-desc {
  font-size: 0.86rem;
  color: var(--sub);
  line-height: 1.55;
  margin-bottom: 12px;
}

.purchase-complete-btn {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text);
  border-radius: 9999px;
  color: var(--bg);
  font-size: 1rem;
  font-weight: 700;
}

/* ==================== 6. 購入履歴 ==================== */
.history-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.history-card {
  width: 100%;
  background-color: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.history-card:hover {
  opacity: 0.95;
  transform: scale(0.995);
}

.history-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background-color: #ffffff;
  display: block;
  padding: 20px;
}

.history-info {
  padding: 14px 20px 20px;
  border-top: 1px solid #f2f2f5;
  background-color: #ffffff;
}

.history-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.history-creator {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sub);
}

/* ==================== 7. クリーン・テキスト表示＆独立リーガルページ ==================== */
.clean-text-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 4px 48px;
}

.clean-text-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clean-text-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--title);
  letter-spacing: -0.01em;
}

.clean-text-body {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--sub);
}

/* ==================== 8. 独立ドキュメントページ（totsu.netスタイル） ==================== */
.doc-page {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
  user-select: text;
  background-color: var(--bg);
}

.doc-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: calc(40px + var(--sat)) 24px calc(56px + var(--sab));
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.doc-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #333333;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 24px;
}

.doc-lead {
  font-size: 0.92rem;
  line-height: 1.85;
  color: #555555;
  margin-bottom: 8px;
}

.doc-section {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: #333333;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.doc-text {
  font-size: 0.92rem;
  line-height: 1.85;
  color: #555555;
}

.doc-note {
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--sub);
}

.doc-list {
  list-style: disc;
  padding-left: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.92rem;
  line-height: 1.8;
  color: #555555;
}

.doc-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 2px;
}

.doc-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: #333333;
  text-decoration: underline;
  text-underline-offset: 4px;
  line-height: 1.6;
}

.doc-link:hover {
  opacity: 0.65;
}

.doc-footer {
  margin-top: auto;
  padding-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.doc-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 0.72rem;
  color: var(--sub);
  line-height: 1.6;
}

.doc-footer-links a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.doc-footer-links a:hover {
  color: #333333;
  text-decoration: underline;
}

.doc-footer-links .sep {
  opacity: 0.4;
  user-select: none;
}
