: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%;
  height: 58px;
  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 {
  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;
}

.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);
  overflow-wrap: anywhere;
  max-width: 100%;
}

.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-x: hidden;
  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: 12px;
  width: 100%;
  max-width: 480px;
  margin: 20px 0 36px;
}

.menu-stack-btn {
  width: 100%;
  height: 52px;
  background-color: #ffffff;
  color: var(--text);
  border-radius: 14px;
  font-size: 0.94rem;
  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: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: auto;
  text-align: center;
  flex-shrink: 0;
  padding: 40px 24px calc(24px + var(--sab));
  background-color: #52525b;
  color: rgba(255, 255, 255, 0.85);
}

.menu-bottom-footer {
  margin-bottom: calc(-20px - var(--sab));
}

.main-bottom-footer {
  margin-bottom: calc(-24px - var(--sab));
}

.menu-bottom-footer .stripe-badge-text,
.main-bottom-footer .stripe-badge-text {
  color: rgba(255, 255, 255, 0.85);
}

.menu-bottom-footer .stripe-badge-logo,
.main-bottom-footer .stripe-badge-logo {
  color: #ffffff;
}

.menu-bottom-footer .menu-footer-links,
.main-bottom-footer .menu-footer-links {
  color: rgba(255, 255, 255, 0.82);
}

.menu-bottom-footer .footer-aa-content,
.main-bottom-footer .footer-aa-content {
  color: rgba(255, 255, 255, 0.75);
}

.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,
.menu-footer-links .footer-link-btn {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

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

.menu-bottom-footer .menu-footer-links a:hover,
.menu-bottom-footer .menu-footer-links .footer-link-btn:hover,
.main-bottom-footer .menu-footer-links a:hover,
.main-bottom-footer .menu-footer-links .footer-link-btn:hover {
  color: #ffffff;
}

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

.footer-aa-row {
  margin-top: 14px;
  width: 100%;
  overflow: hidden;
  user-select: none;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.footer-aa-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  animation: aa-marquee 25s linear infinite;
  will-change: transform;
}

.footer-aa-content {
  font-family: "MS PGothic", "IPAMonaPGothic", "Mona", monospace, sans-serif;
  font-size: 0.72rem;
  color: var(--sub);
  opacity: 0.55;
  letter-spacing: 0.08em;
  padding-right: 48px;
  display: inline-block;
}

@keyframes aa-marquee {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

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

.screen-scroll-container.no-header {
  padding-top: calc(20px + var(--sat));
}

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

.sign-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

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

.sign-card-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background-color: #ffffff;
}

.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: var(--title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}

.sign-card-stock {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--sub);
  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: var(--title);
  line-height: 1;
}

.sign-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 28px;
  background-color: #18181b;
  border-radius: 9999px;
  color: #ffffff;
  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.88;
}

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

.sign-buy-btn.owned {
  background-color: #f4f4f5;
  color: var(--text);
}

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

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

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

@media (min-width: 600px) {
  .sign-grid {
    gap: 16px;
  }
  .sign-card {
    border-radius: 18px;
  }
  .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,
  .sign-delete-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;
}

.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;
}

.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-collapse {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.accordion-select-collapse.open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.accordion-select-body {
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.accordion-select-collapse.open .accordion-select-body {
  border-top-color: #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);
  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;
  text-decoration: none;
}

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

.history-row {
  width: 100%;
  background-color: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.history-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.history-serial-tag {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--sub);
  letter-spacing: 0.03em;
}

.history-date {
  font-size: 0.74rem;
  font-weight: 500;
  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;
}

/* ==================== 8. 確認ダイアログ（ConfirmModal） ==================== */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirm-modal-dialog {
  width: 100%;
  max-width: 320px;
  background-color: #ffffff;
  border-radius: 20px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.confirm-modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--title);
  margin-bottom: 8px;
}

.confirm-modal-message {
  font-size: 0.88rem;
  color: var(--sub);
  line-height: 1.5;
  margin-bottom: 22px;
}

.confirm-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.confirm-modal-btn {
  height: 44px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.confirm-modal-btn:active {
  transform: scale(0.96);
}

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

.confirm-modal-btn.cancel:hover {
  background-color: #e4e4e7;
}

.confirm-modal-btn.destructive {
  background-color: #ef4444;
  color: #ffffff;
}

.confirm-modal-btn.destructive:hover {
  opacity: 0.9;
}

.confirm-modal-btn.confirm {
  background-color: #18181b;
  color: #ffffff;
}

/* サムネイルクロップ調整モーダル (400x400 WebP) */
.sign-upload-preview.cropped {
  object-fit: cover;
  padding: 0;
}

.crop-modal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 20px;
  padding-top: 8px;
}

.crop-help-desc {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sub);
  text-align: center;
  line-height: 1.5;
  max-width: min(300px, 82vw);
}

.crop-viewport-container {
  position: relative;
  width: min(300px, 82vw);
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  border: 2px dashed #d1d1d6;
  background-color: #ffffff;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
}

.crop-viewport-container.dragging {
  cursor: grabbing;
}

.crop-preview-img {
  position: absolute;
  width: var(--crop-base-w, 300px);
  height: var(--crop-base-h, 300px);
  min-width: 100%;
  min-height: 100%;
  max-width: none;
  max-height: none;
  pointer-events: none;
  transform: translate(var(--crop-x, 0px), var(--crop-y, 0px)) scale(var(--crop-zoom, 1));
  transition: transform 0.05s linear;
}

.crop-viewport-container.dragging .crop-preview-img {
  transition: none;
}

.crop-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(300px, 82vw);
  margin-top: 4px;
}

.empty-upload-link {
  margin-top: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--title);
  text-decoration: underline;
  text-underline-offset: 4px;
  background: transparent;
  cursor: pointer;
  padding: 6px 10px;
}

.empty-upload-link:hover {
  opacity: 0.75;
}

/* クリエイター売上サマリー */
.sales-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.sales-summary-card {
  background-color: #ffffff;
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sales-summary-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sub);
}

.sales-summary-amount {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--title);
  letter-spacing: -0.02em;
}

.sales-summary-note {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--sub);
}

.sales-summary-meta {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f2;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

/* クリエイター専用ショップページ (/@handle) */
.shop-page-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 12px 16px 32px;
}

.shop-empty-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 20px;
  text-align: center;
  gap: 8px;
}

/* Sainy ミニマルLP (HomeLanding) */
.lp-minimal {
  width: 100%;
  max-width: 880px;
  flex: 1 0 auto;
  margin: 0 auto;
  padding: 20px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
}

.lp-hero {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 42px;
}

.lp-claim-area {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lp-claim-status {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sub);
  line-height: 1.4;
}

.lp-claim-status.is-available {
  color: #15803d;
}

.lp-claim-status.is-unavailable {
  color: #b91c1c;
}

.lp-status-mark {
  font-weight: 800;
}

.lp-sections {
  width: 100%;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lp-band {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 40px 24px 48px;
}

.lp-band-white {
  background-color: #ffffff;
}

.lp-band-muted {
  background-color: var(--bg);
}

.lp-info-inner {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.lp-info-heading {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--title);
  text-align: center;
  letter-spacing: 0.04em;
}

.lp-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.lp-info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 4px 0;
}

.lp-step-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--sub);
}

.lp-info-card-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text);
}

.lp-info-card-desc {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--sub);
  line-height: 1.7;
}

.header-logo-spacer {
  display: block;
  width: 1px;
  height: 1px;
}

.lp-brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.lp-center-logo {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(3.2rem, 17vw, 4.6rem);
  font-weight: 800;
  color: var(--title);
  letter-spacing: -0.045em;
  line-height: 0.95;
  user-select: none;
}

.lp-center-ruby {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sub);
  letter-spacing: 0.24em;
  text-indent: 0.24em;
}

.lp-center-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: 0.08em;
}

.lp-claim-form {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lp-claim-input-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  height: 52px;
  background-color: #ffffff;
  border-radius: 14px;
  padding: 0 16px;
}

.lp-claim-prefix {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sub);
  white-space: nowrap;
  flex-shrink: 0;
}

.lp-claim-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  padding-left: 2px;
}

.lp-claim-input::placeholder {
  color: #c7c7cc;
  font-weight: 600;
}

.lp-claim-submit {
  height: 52px;
  padding: 0 24px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.lp-claim-submit:hover {
  opacity: 0.85;
}

.lp-claim-submit:active:not(:disabled) {
  transform: scale(0.98);
}

.lp-claim-submit:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

@media (min-width: 600px) {
  .lp-minimal {
    padding-top: 4px;
  }
  .lp-hero {
    gap: 24px;
  }
  .lp-center-logo {
    font-size: 6.0rem;
  }
  .lp-center-subtitle {
    font-size: 0.95rem;
  }
  .lp-sections {
    margin-top: 12px;
  }
  .lp-band {
    padding: 32px 24px 56px;
  }
  .lp-info-heading {
    font-size: 1.5rem;
  }
  .lp-card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

.lp-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.lp-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lp-card-grid .lp-reveal:nth-child(2) {
  transition-delay: 0.08s;
}

.lp-card-grid .lp-reveal:nth-child(3) {
  transition-delay: 0.16s;
}

@media (prefers-reduced-motion: reduce) {
  .lp-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.register-url-preview {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  background-color: #f4f4f5;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 0.92rem;
  word-break: break-all;
}

.register-url-prefix {
  font-weight: 700;
  color: var(--sub);
}

.register-url-handle {
  font-weight: 800;
  color: var(--text);
}

.lp-auth-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  color: var(--sub);
  font-size: 0.76rem;
  font-weight: 600;
}

.lp-auth-divider::before,
.lp-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: #e4e4e7;
}

.lp-auth-btn {
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  background-color: #ffffff;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.lp-auth-btn:hover {
  opacity: 0.85;
}

.lp-auth-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.lp-auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lp-auth-btn .google-icon {
  width: 18px;
  height: 18px;
}

.lp-auth-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #d4d4d8;
  border-top-color: var(--text);
  border-radius: 50%;
  flex-shrink: 0;
  animation: btn-spin 0.7s linear infinite;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.lp-legal-note {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--sub);
  line-height: 1.5;
  text-align: center;
}

.lp-legal-text {
  color: var(--sub);
}

.lp-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 4px;
}

.lp-legal-links a {
  color: var(--text);
  text-decoration: underline;
  white-space: nowrap;
}

.lp-legal-links .sep {
  opacity: 0.45;
  user-select: none;
}
