﻿/* ================================================================
   マイページ — 2カラム + タブ
   ================================================================ */

.myformat-layout {
  display: grid;
  grid-template-columns: 55fr 45fr;
  min-height: calc(100vh - 60px);
}

@media screen and (max-width: 1080px) {
  .myformat-layout {
    grid-template-columns: 1fr;
  }
}

.myformat-layout.myformat-layout--usage {
  grid-template-columns: 1fr;
}

.myformat-layout.myformat-layout--usage .myformat-preview-col {
  display: none;
}

.myformat-layout.myformat-layout--usage .myformat-form-col {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.myformat-form-col {
  overflow-y: auto;
  min-width: 0;
}

.myformat-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 28px 48px;
}

@media screen and (max-width: 1080px) {
  .myformat-wrap {
    max-width: none;
    padding: 32px 24px 40px;
  }
}

@media screen and (max-width: 600px) {
  .myformat-wrap {
    padding: 24px 16px 36px;
  }
}

@media screen and (max-width: 375px) {
  .myformat-wrap {
    padding: 20px 12px 32px;
  }
}

@media screen and (max-width: 355px) {
  .myformat-wrap {
    padding: 16px 10px 28px;
  }
}

.myformat-wrap .page-title {
  font-size: 26px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 3px solid #D5DDE8;
}

@media screen and (max-width: 600px) {
  .myformat-wrap .page-title {
    font-size: 22px;
  }
}

.myformat-preview-col {
  background: var(--surface);
  border-left: 1.5px solid var(--border);
  padding: 32px 28px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.myformat-mobile-bar {
  display: none;
}

@media screen and (max-width: 1080px) {
  .myformat-preview-col {
    position: static;
    height: auto;
    border-left: none;
    border-top: 1.5px solid var(--border);
    padding: 28px 20px;
  }

  .myformat-layout:not(.myformat-layout--usage) {
    padding-bottom: calc(56px + var(--safe-bottom));
    box-sizing: border-box;
  }

  .myformat-layout:not(.myformat-layout--usage) .myformat-preview-col {
    display: none;
  }

  .myformat-layout.myformat-layout--preview-open .myformat-preview-col {
    display: block;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: calc(56px + var(--safe-bottom));
    z-index: 110;
    height: auto;
    overflow-y: auto;
    border-top: none;
    padding: 20px 16px 24px;
    background: var(--surface);
  }

  .myformat-mobile-bar {
    display: none;
  }

  .myformat-layout:not(.myformat-layout--usage) .myformat-mobile-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 130;
    min-height: calc(var(--mobile-bar-h) + var(--safe-bottom));
    padding: 0 0 var(--safe-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  .myformat-mobile-bar-btn {
    flex: 1;
    width: 100%;
    min-height: var(--mobile-bar-h);
    margin: 0;
    padding: 0 12px;
    border: none;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
  }

  .myformat-mobile-bar-btn.is-active {
    background: #C0392B;
    color: #fff;
  }

  .myformat-mobile-bar-btn:not(.is-active):active {
    background: #dce8f4;
  }
}

@media screen and (max-width: 355px) {
  .myformat-preview-col {
    padding: 20px 10px;
  }
}

.mf-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border-bottom: none;
  margin-bottom: 24px;
  padding: 6px;
  background: #E8EDF3;
  border-radius: 12px;
}

@media screen and (max-width: 600px) {
  .mf-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    overflow-x: visible;
  }

  .mf-tabs .mf-tab:first-child {
    grid-column: 1 / -1;
  }
}

@media screen and (max-width: 375px) {
  .mf-tabs {
    padding: 4px;
    gap: 4px;
  }
}

.mf-major-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.mf-major-tab {
  padding: 16px 14px;
  font-size: 17px;
  font-weight: 700;
  background: #E8EDF3;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  color: #4B5563;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  line-height: 1.35;
}

@media screen and (max-width: 768px) {
  .mf-major-tab {
    font-size: 15px;
    padding: 14px 10px;
  }
}

.mf-major-tab:hover {
  background: #DCE4ED;
  color: var(--heading);
}

.mf-major-tab.active {
  color: var(--heading);
  background: #FFFFFF;
  border-color: #B8C4D0;
  box-shadow: 0 3px 12px rgba(4, 44, 83, 0.12);
}

.mf-major-panel {
  display: none;
}

.mf-major-panel.active {
  display: block;
}

.mf-sub-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 20px;
  padding: 6px;
  background: #EEF2F6;
  border-radius: 10px;
}

.mf-sub-tab {
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #4B5563;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  white-space: nowrap;
}

@media screen and (max-width: 768px) {
  .mf-sub-tab {
    font-size: 13px;
    padding: 11px 8px;
  }
}

.mf-sub-tab:hover {
  background: rgba(255, 255, 255, 0.65);
  color: var(--heading);
}

.mf-sub-tab.active {
  color: var(--heading);
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(4, 44, 83, 0.1);
}

.mf-sub-panel {
  display: none;
}

.mf-sub-panel.active {
  display: block;
}

.mf-tab {
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #4B5563;
  font-family: inherit;
  transition: background 0.28s ease, color 0.28s ease, box-shadow 0.28s ease;
  white-space: nowrap;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media screen and (max-width: 600px) {
  .mf-tab {
    flex: unset;
    width: auto;
    text-align: center;
    padding: 12px 10px;
    font-size: 14px;
    overflow: visible;
    text-overflow: clip;
  }
}

@media screen and (max-width: 468px) {
  .mf-tab {
    padding: 12px 16px;
    font-size: 14px;
    white-space: nowrap;
  }
}

@media screen and (max-width: 355px) {
  .mf-tab {
    flex: unset;
    font-size: 13px;
    padding: 10px 8px;
  }
}

.mf-tab:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--heading);
}

.mf-tab.active {
  color: var(--heading);
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(4, 44, 83, 0.12);
}

.mf-tab-content {
  display: none;
}

.mf-tab-content.active,
.mf-tab-content.mf-tab-leaving {
  display: block;
}

.mf-tab-content.active {
  animation: utsushiTabIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mf-tab-content.mf-tab-leaving {
  animation: utsushiTabOut 0.24s ease both;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .mf-tab-content.active,
  .mf-tab-content.mf-tab-leaving {
    animation: none;
  }
}

@keyframes utsushiTabIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes utsushiTabOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.mf-form-intro {
  font-size: 16px;
  line-height: 1.75;
  color: #374151;
  background: #E6F1FB;
  border: 1.5px solid #B8D4EF;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.mf-field {
  margin-bottom: 0;
}

.mf-field-card {
  background: #FFFFFF;
  border: 2px solid #B8C4D0;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(4, 44, 83, 0.07);
}

.mf-field-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.15);
}

.mf-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 18px 12px;
  background: #EEF2F6;
  border-bottom: 2px solid #D5DDE8;
  cursor: default;
}

.mf-label-row--section {
  margin-bottom: 0;
}

.mf-label-row--inline {
  padding: 0;
  background: none;
  border: none;
  width: auto;
  flex-shrink: 0;
}

.mf-label-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.4;
}

.label-required {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--danger);
  padding: 5px 12px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.label-optional {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: #4B5563;
  background: #DDE3EA;
  padding: 5px 12px;
  border-radius: 6px;
}

.mf-field-card .mf-input,
.mf-valid-default-box .mf-input {
  display: block;
  margin: 16px 18px 0;
  width: calc(100% - 36px);
  height: 52px;
  padding: 0 16px;
  font-size: 17px;
  background: #FFFFFF;
  border: 2px solid #8896A8;
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mf-field-card:not(:has(.mf-field-hint)) > .mf-input,
.mf-field-card:not(:has(.mf-field-hint)) > textarea.mf-input {
  margin-bottom: 18px;
}

.mf-input {
  height: 52px;
  padding: 0 16px;
  font-size: 17px;
  background: #FFFFFF;
  border: 2px solid #8896A8;
  border-radius: 8px;
  color: var(--text);
  width: 100%;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

@media screen and (max-width: 355px) {
  .mf-input {
    font-size: 16px;
  }
}

.mf-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(24, 95, 165, 0.2);
  background: #FFFFFF;
}

.mf-input-short {
  max-width: 100%;
}

.mf-field-card .mf-input-short {
  max-width: calc(100% - 36px);
}

.mf-field--hidden-display .mf-label-text {
  color: #4B5563;
}

.mf-field--hidden-display .mf-label-row {
  background: #B8C4D0;
  border-bottom-color: #9CA3AF;
}

.mf-field--hidden-display .mf-input {
  background: #9CA3AF;
  border-color: #6B7280;
  color: #374151;
}

.mf-field--hidden-display .mf-field-card {
  border-color: #9CA3AF;
}

.mf-field--hidden-display .mf-show-row {
  opacity: 1;
  background: #FFFFFF;
  border-color: #378ADD;
  box-shadow: 0 0 0 2px rgba(55, 138, 221, 0.15);
}

.mf-field--hidden-display.mf-logo-controls,
.mf-field--hidden-display.mf-logo-tab-card .mf-logo-controls {
  opacity: 0.65;
  pointer-events: none;
  filter: grayscale(0.5);
}

.mf-show-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 14px 18px 16px;
  padding: 14px 16px;
  background: #FFFFFF;
  border: 2px solid #60A5FA;
  border-radius: 8px;
  font-size: 15px;
  box-shadow: 0 1px 4px rgba(24, 95, 165, 0.08);
}

.mf-show-label {
  font-weight: 700;
  font-size: 16px;
  color: #185FA5;
  min-width: 120px;
}

.mf-radio-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.mf-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  padding: 6px 4px;
  min-height: 36px;
}

.mf-radio-input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.mf-section-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 6px;
}

.mf-section-label--detail {
  margin-top: 64px;
  font-size: 24px;
}

.mf-section-label--company {
  margin-top: 64px;
  font-size: 24px;
}

.mf-section-label--remarks {
  margin-top: 64px;
  font-size: 24px;
}

.mf-section-label--advanced {
  margin-top: 64px;
  font-size: 24px;
}

.mf-advanced-layout-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0 8px;
}

.mf-advanced-layout-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 16px 18px;
}

.mf-advanced-layout-row + .mf-advanced-layout-row {
  border-top: 1px solid #E8EDF3;
}

.mf-advanced-layout-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1A1A18;
  line-height: 1.55;
}

.mf-advanced-layout-input {
  display: block;
  width: 100%;
  max-width: 140px;
  height: 44px;
  padding: 0 12px;
  margin: 0;
  font-size: 15px;
  box-sizing: border-box;
}

.mf-advanced-layout-hint {
  margin: 0;
  font-size: 12px;
  color: #718096;
  line-height: 1.6;
}

.mf-issuer-divider {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: 0 0 20px;
}

.mf-field-inline-hint {
  margin: 8px 18px 12px;
}

.mf-section-hint {
  font-size: 15px;
  color: #4B5563;
  margin: 0 18px 4px;
  line-height: 1.65;
}

.mf-valid-hint {
  margin-top: 16px;
}

.mf-valid-extra-row {
  margin: 14px 18px 18px;
}

.mf-valid-inline-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 14px 16px;
  background: #F8FAFC;
  border: 2px solid #D5DDE8;
  border-radius: 10px;
}

.mf-valid-inline-lead,
.mf-valid-inline-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
}

.mf-valid-num-input,
.mf-valid-select-num {
  width: 88px;
  height: 48px;
  padding: 0 12px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: var(--heading);
  background: #FFFFFF;
  border: 2px solid var(--accent);
  border-radius: 8px;
  font-family: inherit;
  outline: none;
}

.mf-valid-select-num {
  width: 72px;
  cursor: pointer;
}

.mf-valid-num-input:focus,
.mf-valid-select-num:focus {
  box-shadow: 0 0 0 3px var(--accent-light);
}

.mf-logo-tab-card .mf-show-row,
.mf-seal-tab-card .mf-show-row {
  margin-top: 16px;
}

.mf-seal-tab-card {
  margin-top: 16px;
}

.mf-seal-tab-card > .mf-section-hint.mf-field-inline-hint {
  margin-top: 16px;
}

.mf-brand-size-grid,
.mf-brand-pos-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 12px 32px;
  padding: 12px 0 0;
}

.mf-brand-size-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.mf-brand-size-label {
  flex: 0 0 7.5em;
  min-width: 7.5em;
  font-size: 13px;
  font-weight: 600;
  color: #4A5568;
  white-space: nowrap;
  text-align: right;
}

.mf-field-card .mf-brand-size-input,
.mf-logo-controls .mf-brand-size-input,
.mf-seal-controls .mf-brand-size-input {
  margin: 0;
  width: 72px;
  height: 40px;
  padding: 0 8px;
  font-size: 15px;
}

.mf-brand-size-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #718096;
  line-height: 1.5;
}

.mf-brand-alpha-warn {
  margin: 8px 0 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  color: #B45309;
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: 8px;
}

.seal-preview-img {
  max-height: 80px;
  max-width: 120px;
  position: static;
}

.mf-brand-area-height-row {
  padding-top: 12px;
  border-top: 1px solid #E8EDF3;
  margin-top: 12px;
}

.mf-brand-area-height-hint {
  margin-top: 6px;
}

.mf-logo-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0;
}

.mf-logo-controls,
.mf-seal-controls {
  padding: 0 18px 18px;
}

.logo-preview-wrap {
  background: #F8FAFC;
  border: 2px solid #D5DDE8;
  border-radius: 8px;
  padding: 12px;
}

.logo-preview-img {
  max-height: 64px;
  max-width: 180px;
  display: block;
}

.mf-logo-btns {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.logo-remove-btn {
  color: var(--danger);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  padding: 8px 4px;
}

.logo-remove-btn:hover {
  text-decoration: underline;
}

@media screen and (max-width: 810px) {
  .avatar-crop-row {
    flex-wrap: wrap;
  }
}

@media screen and (max-width: 600px) {
  .avatar-crop-row {
    flex-direction: column;
  }
}

@media screen and (max-width: 810px) {
  .avatar-crop-arrow {
    display: none;
  }
}

@media screen and (max-width: 600px) {
  .avatar-crop-viewport {
    width: 160px;
    height: 160px;
  }
}

@media screen and (max-width: 375px) {
  .avatar-crop-viewport {
    width: 140px;
    height: 140px;
  }
}

@media screen and (max-width: 600px) {
  .avatar-crop-circle-wrap {
    width: 160px;
    height: 160px;
  }
}

@media screen and (max-width: 375px) {
  .avatar-crop-circle-wrap {
    width: 140px;
    height: 140px;
  }
}

@media screen and (max-width: 768px) {
  .action-row--save {
    flex-direction: column;
    align-items: stretch;
  }
}

@media screen and (max-width: 768px) {
  .billing-cta-text--pc {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .billing-cta-text--sp {
    display: inline;
    text-align: center;
  }
}

@media screen and (max-width: 768px) {
  .billing-section-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    line-height: 1.45;
  }
}

@media screen and (max-width: 355px) {
  .billing-section-cta {
    width: 100%;
  }
}

@media screen and (max-width: 355px) {
  .billing-section-btn {
    width: 100%;
  }
}

@media screen and (max-width: 355px) {
  .campaign-redeem-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media screen and (max-width: 355px) {
  .campaign-redeem-input {
    max-width: none;
    width: 100%;
  }
}

@media screen and (max-width: 355px) {
  .campaign-redeem-btn {
    width: 100%;
  }
}

@media screen and (max-width: 768px) {
  .header {
    padding: 0 12px;
  }
}

@media screen and (max-width: 600px) {
  .header {
    padding: 0 1rem;
  }
}

@media screen and (max-width: 355px) {
  .header {
    padding: 0 8px;
    height: 56px;
  }
}

@media screen and (max-width: 768px) {
  .header-badges-desktop {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .header-hamburger {
    display: flex;
  }
}

@media screen and (max-width: 355px) {
  .header-hamburger {
    width: 36px;
    height: 36px;
  }
}

@media screen and (max-width: 768px) {
  .user-menu-wrap .user-dropdown {
    display: none !important;
  }
}

@media screen and (max-width: 768px) {
  .user-avatar-btn {
    pointer-events: none;
    cursor: default;
  }
}

@media screen and (max-width: 768px) {
  .user-avatar-btn:hover,
  .user-avatar-btn[aria-expanded="true"] {
    border-color: #94A3B8;
    box-shadow: 0 0 0 1px #E5E7EB;
  }
}

@media screen and (max-width: 355px) {
  .user-avatar-btn {
    width: 32px;
    height: 32px;
    padding: 2px;
  }
}

@media screen and (max-width: 768px) {
  .header-user-name {
    max-width: 88px;
    font-size: 14px;
  }
}

@media screen and (max-width: 600px) {
  .header-user-name {
    font-size: 13px;
    max-width: 72px;
  }
}

@media screen and (max-width: 355px) {
  .header-user-name {
    font-size: 12px;
    max-width: 56px;
  }
}

@media screen and (max-width: 768px) {
  .header-user-id {
    font-size: 11px;
  }
}

@media screen and (max-width: 600px) {
  .header-user-id {
    font-size: 10px;
  }
}

@media screen and (max-width: 355px) {
  .header-user-id {
    font-size: 9px;
  }
}

@media screen and (max-width: 600px) {
  .header-user-box {
    gap: 6px;
  }
}

@media screen and (max-width: 355px) {
  .header-user-box {
    gap: 4px;
  }
}

@media screen and (max-width: 355px) {
  .header-user-profile {
    gap: 6px;
  }
}

@media screen and (max-width: 600px) {
  .usage-badge {
    display: none;
  }
}

@media screen and (max-width: 355px) {
  .logo-img {
    height: 30px;
  }
}

@media screen and (max-width: 355px) {
  .user-photo {
    width: 32px;
    height: 32px;
  }
}

@media screen and (max-width: 355px) {
  .avatar {
    width: 32px;
    height: 32px;
  }
}

.mf-valid-default-box {
  margin-top: 8px;
  padding: 0 0 16px;
}

.mf-valid-default-box .mf-input {
  margin-bottom: 0;
}

/* ================================================================
   マイページ — プレビューパネル
   ================================================================ */

.mf-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.mf-preview-label {
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--heading);
  font-weight: 700;
  margin: 0;
}

.mf-preview-loupe-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

@media screen and (max-width: 768px) {
  .mf-preview-loupe-label {
    display: none;
  }
}

.mf-preview-loupe-input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.mf-preview-note {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.mf-preview-touch-hint {
  display: none;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.5;
}

@media screen and (max-width: 768px) {
  .mf-preview-touch-hint {
    display: block;
  }
}

.mf-preview-viewport {
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 8px;
  max-width: 100%;
  touch-action: pan-x pan-y pinch-zoom;
}

@media screen and (max-width: 768px) {
  .mf-preview-viewport {
    overflow: auto;
    touch-action: none;
  }
}

@media screen and (max-width: 355px) {
  .mf-preview-viewport {
    min-height: 240px;
  }
}

.mf-preview-viewport.mf-preview-loupe-active {
  cursor: none;
}

.mf-preview-viewport.mf-preview-loupe-active .mf-preview-doc {
  cursor: none;
}

.mf-preview-stage {
  position: relative;
  margin: 0 auto;
}

.mf-preview-stage.is-touch-zoomed {
  margin: 0;
}

.mf-preview-canvas {
  position: absolute;
  left: -9999px;
  top: 0;
  pointer-events: none;
}

.mf-preview-loupe {
  position: absolute;
}

.mf-preview-doc {
  box-sizing: border-box;
  width: 794px;
  min-height: 1123px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 40px 56px 32px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: #1A1A18;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transform-origin: top left;
}

.mfp-table-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.mfp-remarks-block {
  margin-top: auto;
  padding-top: 18px;
}

.mfp-remarks-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1A1A18;
}

.mfp-remarks-box {
  border: 1px solid #1A1A18;
  min-height: 220px;
  padding: 12px 14px;
  box-sizing: border-box;
}

.mfp-remarks-content {
  font-size: 13px;
  line-height: 1.7;
  color: #333;
}

.mfp-remarks-content p {
  margin: 0 0 6px;
  white-space: pre-wrap;
  word-break: break-all;
}

.mfp-remarks-content p:last-child {
  margin-bottom: 0;
}

.mfp-title-center {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
  margin-bottom: 18px;
  color: #1A1A18;
}

.mfp-middle-row {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 40px;
  margin-bottom: 12px;
}

.mfp-left-block {
  flex: 0 0 auto;
  width: 50%;
  max-width: 50%;
  min-width: 0;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mfp-right-block {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.mfp-meta-block {
  font-size: 11px;
  line-height: 1.5;
  width: auto;
  max-width: 100%;
  color: #444;
}

.mfp-issuer-block {
  text-align: left;
  width: auto;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.5;
}
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 2px;
}

.mfp-meta-row[hidden] {
  display: none;
}

.mfp-meta-label {
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 68px;
  text-align: right;
}

.mfp-meta-value {
  text-align: right;
  word-break: break-all;
  min-width: 88px;
}

.mfp-subject-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  margin-bottom: 8px;
}

.mfp-subject-row[hidden] {
  display: none;
}

.mfp-info-label {
  color: #666;
  flex-shrink: 0;
  min-width: 2em;
}

.mfp-subject-value {
  flex: 1;
  min-width: 0;
  white-space: pre-line;
  word-break: break-all;
  line-height: 1.55;
}

.mfp-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  width: 100%;
  border-bottom: 2px solid #1A1A18;
  padding-bottom: 6px;
  margin-top: auto;
}

.mfp-amount-row[hidden] {
  display: none;
}

.mfp-amount-label {
  font-size: 14px;
  color: #555;
  font-weight: 500;
  flex-shrink: 0;
}

.mfp-amount {
  font-size: 22px;
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}

.mfp-row-empty-cell {
  height: 20px;
  border-bottom-color: #E8E6DF;
}

.mfp-row-empty-cell.mfp-td-first {
  color: transparent;
}

.mfp-issuer-block[hidden] {
  display: none;
}

.mfp-issuer-logo {
  display: none;
  position: relative;
  z-index: 1;
}

.mfp-brand-area {
  position: relative;
  width: 100%;
  min-height: 40px;
  margin-bottom: 4px;
}

.mfp-brand-area[hidden] {
  display: none;
}

.mfp-issuer-seal {
  display: none;
  position: absolute;
  z-index: 2;
  object-fit: contain;
}

.mfp-issuer-name {
  font-weight: 700;
  font-size: 14px;
  color: #1A1A18;
  margin-bottom: 2px;
}

.mfp-issuer-name[hidden] {
  display: none;
}

.mfp-issuer-contact {
  font-size: 12px;
  color: #555;
  white-space: pre-line;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.mfp-issuer-contact[hidden] {
  display: none;
}

.mfp-client {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  padding: 0;
  border-bottom: none;
  display: block;
}

.mfp-client[hidden] {
  display: none;
}

.mfp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 8px;
  table-layout: auto;
}

.mfp-th {
  border-top: 2px solid #1A1A18;
  border-bottom: 1px solid #1A1A18;
  padding: 7px 4px;
  font-weight: 600;
  color: #333;
  text-align: center;
  font-size: 13px;
  white-space: nowrap;
}

.mfp-th-first {
  text-align: left;
  width: auto;
}

.mfp-th-qty,
.mfp-th-unit,
.mfp-th-price,
.mfp-th-amount {
  width: 1%;
}

.mfp-th-price,
.mfp-th-amount {
  text-align: right;
  padding-right: 8px;
}

.mfp-td-price,
.mfp-td-amount {
  text-align: right;
  padding-right: 8px;
}

.mfp-td {
  padding: 5px 4px;
  border-bottom: 1px solid #DDDBD3;
  text-align: center;
  vertical-align: top;
  font-size: 13px;
}

.mfp-td-qty,
.mfp-td-unit,
.mfp-td-price,
.mfp-td-amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.mfp-td-first {
  text-align: left;
}

.mfp-td-qty,
.mfp-td-unit {
  text-align: center;
}

.mfp-totals-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  width: 280px;
  font-size: 13px;
  line-height: 1.35;
}

.mfp-total-line {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 2px 0;
  border-bottom: 1px solid #E5E7EB;
}

.mfp-total-grand {
  font-weight: 700;
  font-size: 15px;
  border-top: 1px solid #1A1A18;
  border-bottom: none;
  padding-top: 6px;
  margin-top: 2px;
}

.mfp-total {
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  border-top: 1px solid #1A1A18;
  padding-top: 8px;
}

/* ================================================================
   マイページ — 大セクション・登録情報
   ================================================================ */

.mf-major-section {
  margin-bottom: 36px;
}

.mf-major-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  letter-spacing: 0.04em;
}

.mf-account-section {
  margin-top: 0;
}

.mf-field-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin: 8px 18px 16px;
  line-height: 1.6;
}

.mf-input-readonly {
  background: #F5F4F0;
  color: var(--muted);
  cursor: default;
}

/* ================================================================
   共通カード・バッジ
   ================================================================ */

.format-registered-badge {
  margin-top: 20px;
  padding: 14px 18px;
  background: #EAF6EE;
  color: var(--success);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.format-registered-badge.format-registered-badge--hiding {
  opacity: 0;
  transform: translateY(-6px);
}

.format-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 14px;
  line-height: 1.7;
}

.color-swatches {
  display: flex;
  gap: 10px;
  align-items: center;
}

.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}

.swatch:hover {
  transform: scale(1.1);
}

.swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text);
}

/* ================================================================
   備考欄プリセット（マイページ）
   ================================================================ */

.mf-remarks-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 18px 16px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  background: #FFF8F3;
  border: 2px dashed var(--accent);
  border-radius: 10px;
  cursor: pointer;
}

.mf-remarks-add-btn:hover {
  background: var(--accent-light);
}

.mf-section-sort-hint {
  margin: 0 18px 8px;
  font-size: 12px;
  color: #888;
  line-height: 1.5;
}

.mf-sortable-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mf-sortable-item {
  position: relative;
  padding-left: 34px;
}

.mf-drag-handle {
  position: absolute;
  left: 6px;
  top: 18px;
  width: 24px;
  height: 32px;
  border: none;
  background: #F3F4F6;
  color: #888;
  border-radius: 6px;
  cursor: grab;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  letter-spacing: -2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
}

.mf-drag-handle:active {
  cursor: grabbing;
}

.mf-sortable-item--dragging {
  opacity: 0.55;
}

.mf-sortable-item--drop-before::before,
.mf-sortable-item--drop-after::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: #2563EB;
  border-radius: 2px;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.mf-sortable-item--drop-before::before {
  top: 0;
  transform: translateY(-1.5px);
}

.mf-sortable-item--drop-after::after {
  bottom: 0;
  transform: translateY(1.5px);
}

.mf-custom-add-btn {
  display: block;
  width: calc(100% - 36px);
  margin: 8px auto 6px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  color: var(--accent);
  background: #FFF8F3;
  border: 2px dashed var(--accent);
  border-radius: 10px;
  cursor: pointer;
}

.mf-custom-add-btn:hover:not(:disabled) {
  background: var(--accent-light);
}

.mf-custom-add-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mf-custom-add-note {
  margin: 0 auto 18px;
  max-width: min(100%, 420px);
  padding: 0 18px;
  text-align: center;
  font-size: 12px;
  color: #888;
  line-height: 1.5;
}

.mf-custom-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 14px;
  margin-bottom: 0;
  background: #F8FAFC;
  border-bottom: 2px solid #D5DDE8;
}

.mf-custom-field-badge {
  display: inline-block;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #0C447C;
  background: #E8F2FC;
  border-radius: 999px;
  padding: 4px 10px;
}

.mf-custom-remove-btn {
  flex-shrink: 0;
  border: 2px solid var(--danger);
  background: #FEF2F2;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 14px;
  border-radius: 6px;
  line-height: 1.3;
  transition: background 0.15s, border-color 0.15s;
}

.mf-custom-remove-btn:hover {
  background: #FEE2E2;
  border-color: #B91C1C;
}

.mf-remarks-add-form {
  margin: 0 18px 20px;
}

.mf-remarks-preset-textarea {
  min-height: 120px;
  padding: 12px 14px;
  line-height: 1.6;
  resize: vertical;
}

.mf-remarks-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.mf-remarks-list-title {
  margin: 8px 18px 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
}

.mf-remarks-list-divider {
  margin-bottom: 12px;
}

.mf-remarks-presets-list {
  margin: 0 18px 24px;
}

.mf-remarks-empty {
  margin: 0;
  padding: 16px;
  font-size: 14px;
  color: var(--muted);
  background: #F8FAFC;
  border: 2px dashed #D5DDE8;
  border-radius: 10px;
  text-align: center;
}

.mf-remarks-preset-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #FFFFFF;
  border: 2px solid #D5DDE8;
  border-radius: 10px;
}

.mf-remarks-preset-main {
  flex: 1;
  min-width: 0;
}

.mf-remarks-preset-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 10px;
  word-break: break-all;
}

.mf-remarks-preset-show {
  margin: 0;
}

.mf-remarks-preset-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.mf-remarks-menu-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  color: #4A5568;
  background: #F8FAFC;
  border: 2px solid #D5DDE8;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.mf-remarks-menu-btn:hover {
  background: #EDF2F7;
}

.mf-remarks-menu-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 120px;
  padding: 6px;
  background: #FFFFFF;
  border: 2px solid #D5DDE8;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.mf-remarks-menu-delete {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  color: var(--danger);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.mf-remarks-menu-delete:hover {
  background: #FEF2F2;
}

/* ================================================================
   アニメーション
   ================================================================ */

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

@keyframes pop-in {
  0%   { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

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