/*
 * member-portal.css
 * 会員サイト専用スタイルシート
 * ロジグロ 会員ポータル
 */

/* =============================================
   CSS カスタムプロパティ（デザイントークン）
   ============================================= */
:root {
  --brand:          #1460C8;
  --brand-light:    #E8F0FD;
  --brand-mid:      #4A85E0;
  --text-primary:   #1A1D23;
  --text-secondary: #5A6278;
  --text-muted:     #9BA3B8;
  --bg-page:        #F2F5FA;
  --bg-card:        #FFFFFF;
  --bg-surface:     #F7F9FD;
  --border:         #E4E9F2;
  --border-strong:  #CDD4E8;
  --danger:         #D93B3B;
  --danger-light:   #FEF0F0;
  --success:        #1A8C5A;
  --success-light:  #E8F7EF;
  --warning:        #C07A10;
  --warning-light:  #FEF6E7;
  --shadow-sm:      0 1px 4px rgba(20,96,200,0.06), 0 0 0 1px rgba(20,96,200,0.04);
  --shadow-lg:      0 12px 40px rgba(20,96,200,0.14), 0 2px 8px rgba(20,96,200,0.06);
  --nav-h:          68px;
  --safe-bottom:    env(safe-area-inset-bottom, 0px);
  --radius-md:      12px;
  --radius-lg:      16px;
  --transition:     0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

/* =============================================
   リセット & ベース
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: 'Noto Sans JP', -apple-system, 'Hiragino Sans', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  overscroll-behavior: none;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a      { text-decoration: none; color: inherit; }

/* =============================================
   ヘッダー
   ============================================= */
.member-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.member-site-logo {
  display: flex;
  align-items: center;
  gap: 6px;
}
.member-logo-mark {
  width: 28px;
  height: 28px;
  background: var(--brand);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.member-logo-mark svg { width: 16px; height: 16px; fill: #fff; }
.member-logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: -0.2px;
}
.member-logo-sub { font-size: 8px; color: var(--text-muted); }

.member-header-actions { display: flex; gap: 7px; }
.member-btn-ghost {
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  border: 1.5px solid var(--brand);
  color: var(--brand);
  background: transparent;
  transition: background var(--transition);
}
.member-btn-ghost:active { background: var(--brand-light); }
.member-btn-solid {
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  background: var(--brand);
  color: #fff;
  transition: opacity var(--transition);
}
.member-btn-solid:active { opacity: 0.82; }

/* =============================================
   ページラッパー & パンくず & タイトル
   ============================================= */
.member-page-wrapper {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
}
.member-breadcrumb {
  padding: 10px 16px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.member-breadcrumb a    { color: var(--brand); }
.member-breadcrumb svg  { width: 10px; height: 10px; stroke: var(--text-muted); fill: none; }

.member-page-header { padding: 14px 16px 0; }
.member-page-title  { font-size: 22px; font-weight: 600; letter-spacing: -0.4px; line-height: 1.2; }

/* =============================================
   ユーザーカード
   ============================================= */
.member-user-card {
  margin: 16px 16px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  animation: memberFadeUp 0.3s ease both 0.05s;
}
.member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-light);
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.member-avatar svg {
  width: 22px;
  height: 22px;
  stroke: var(--brand-mid);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.member-user-greeting { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.member-user-name     { font-size: 15px; font-weight: 600; }
.member-user-badge {
  font-size: 10px;
  background: var(--success-light);
  color: var(--success);
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
}

/* =============================================
   セクションタイトル & フィルタータブ
   ============================================= */
.member-section-title {
  padding: 20px 16px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.member-filter-scroll {
  padding: 0 16px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 14px;
  animation: memberFadeUp 0.3s ease both 0.10s;
}
.member-filter-scroll::-webkit-scrollbar { display: none; }
.member-filter-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  border-radius: 34px;
  border: 1.5px solid var(--border-strong);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
  cursor: pointer;
}
.member-filter-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(20,96,200,0.25);
}
.member-tab-badge {
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.member-filter-tab.active     .member-tab-badge { background: rgba(255,255,255,0.25); color: #fff; }
.member-filter-tab:not(.active) .member-tab-badge { background: var(--brand-light); color: var(--brand); }

/* =============================================
   書類リスト
   ============================================= */
.member-doc-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.member-doc-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.member-doc-item:active { transform: scale(0.985); box-shadow: none; }

.member-doc-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.member-doc-icon-wrap svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.member-doc-icon-wrap.estimate { background: #EEF3FE; } .member-doc-icon-wrap.estimate svg { stroke: #1460C8; }
.member-doc-icon-wrap.contract { background: #E9F8F1; } .member-doc-icon-wrap.contract svg { stroke: #1A8C5A; }
.member-doc-icon-wrap.invoice  { background: #FEF6E7; } .member-doc-icon-wrap.invoice  svg { stroke: #C07A10; }

.member-doc-meta   { flex: 1; min-width: 0; }
.member-doc-name   { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.member-doc-info-row { display: flex; align-items: center; gap: 6px; }
.member-doc-date   { font-size: 11px; color: var(--text-muted); }
.member-doc-type-badge { font-size: 10px; padding: 2px 7px; border-radius: 4px; font-weight: 500; }
.member-badge-estimate { background: var(--brand-light); color: var(--brand); }
.member-badge-contract { background: var(--success-light); color: var(--success); }
.member-badge-invoice  { background: var(--warning-light); color: var(--warning); }

.member-doc-arrow svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
}
.member-list-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  color: var(--text-muted);
  font-size: 13px;
  gap: 8px;
  text-align: center;
}
.member-list-empty svg {
  width: 36px;
  height: 36px;
  stroke: var(--border-strong);
  fill: none;
  stroke-width: 1.2;
}

/* 書類アイテム 入場アニメーション */
.member-doc-item:nth-child(1) { animation: memberFadeUp .3s ease both .13s; }
.member-doc-item:nth-child(2) { animation: memberFadeUp .3s ease both .17s; }
.member-doc-item:nth-child(3) { animation: memberFadeUp .3s ease both .21s; }
.member-doc-item:nth-child(4) { animation: memberFadeUp .3s ease both .25s; }
.member-doc-item:nth-child(5) { animation: memberFadeUp .3s ease both .29s; }
.member-doc-item:nth-child(6) { animation: memberFadeUp .3s ease both .33s; }

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

/* =============================================
   ボトムナビ（モバイル）
   ============================================= */
.member-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  align-items: flex-start;
  padding-top: 8px;
  box-shadow: 0 -4px 20px rgba(20,96,200,0.07);
}
.member-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  cursor: pointer;
  position: relative;
  border: none;
  background: transparent;
  transition: opacity 0.15s;
}
.member-nav-item:active { opacity: 0.65; }
.member-nav-icon-wrap {
  width: 38px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background var(--transition);
  position: relative;
}
.member-nav-item.active .member-nav-icon-wrap { background: var(--brand-light); }
.member-nav-item svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke: var(--text-muted);
  transition: stroke var(--transition);
}
.member-nav-item.active svg  { stroke: var(--brand); }
.member-nav-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  transition: color var(--transition), font-weight var(--transition);
  letter-spacing: -0.1px;
}
.member-nav-item.active .member-nav-label { color: var(--brand); font-weight: 600; }
.member-nav-badge {
  position: absolute;
  top: -3px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  background: #D93B3B;
  border-radius: 8px;
  border: 2px solid var(--bg-card);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* =============================================
   ドロワー（「その他」メニュー）
   ============================================= */
.member-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,20,40,0.45);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.member-drawer-overlay.visible { opacity: 1; pointer-events: all; }

.member-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 310;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding-bottom: calc(16px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform var(--transition);
  box-shadow: var(--shadow-lg);
  max-height: 82vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.member-drawer.open { transform: translateY(0); }

.member-drawer-handle-area {
  padding: 12px 0 4px;
  display: flex;
  justify-content: center;
  cursor: pointer;
}
.member-drawer-handle {
  width: 36px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
}
.member-drawer-header {
  padding: 4px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.member-drawer-title { font-size: 16px; font-weight: 600; }
.member-drawer-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.member-drawer-close svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}
.member-drawer-section { padding: 8px 0; }
.member-drawer-section + .member-drawer-section { border-top: 1px solid var(--border); }
.member-drawer-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 8px 20px 4px;
}

/* 公開サイトバナー */
.member-site-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 16px 4px;
  padding: 14px 16px;
  background: var(--brand);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity var(--transition);
}
.member-site-banner:active { opacity: 0.85; }
.member-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.member-banner-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
.member-banner-text  { flex: 1; }
.member-banner-label { font-size: 13px; font-weight: 600; color: #fff; }
.member-banner-desc  { font-size: 11px; color: rgba(255,255,255,0.72); margin-top: 2px; }
.member-banner-arrow svg { width: 16px; height: 16px; stroke: rgba(255,255,255,0.8); fill: none; stroke-width: 2.5; }

/* ドロワーアイテム */
.member-drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  cursor: pointer;
  transition: background var(--transition);
}
.member-drawer-item:active { background: var(--bg-surface); }
.member-drawer-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.member-drawer-item-icon svg { width: 18px; height: 18px; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.member-icon-blue                  { background: var(--brand-light); }
.member-icon-blue svg              { stroke: var(--brand); }
.member-icon-gray                  { background: var(--bg-surface); border: 1px solid var(--border); }
.member-icon-gray svg              { stroke: var(--text-secondary); }
.member-icon-red                   { background: var(--danger-light); }
.member-icon-red  svg              { stroke: var(--danger); }
.member-drawer-item-text           { flex: 1; }
.member-drawer-item-label          { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.member-drawer-item-label.danger   { color: var(--danger); }
.member-drawer-item-desc           { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.member-drawer-item-arrow svg      { width: 14px; height: 14px; stroke: var(--text-muted); fill: none; stroke-width: 2; }

/* =============================================
   レイアウトラッパー（モバイル：縦積み）
   ============================================= */
.member-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* サイドバーはモバイルで非表示 */
.member-sidebar { display: none; }

/* =============================================
   デスクトップ レスポンシブ（768px以上）
   ============================================= */
@media (min-width: 768px) {

  /* ---------- レイアウト ---------- */
  .member-layout {
    flex-direction: row;
    align-items: stretch;
  }
  .member-main-area {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  /* ボトムナビ非表示 */
  .member-bottom-nav   { display: none; }
  .member-page-wrapper { padding-bottom: 0; }

  /* ---------- サイドバー ---------- */
  .member-sidebar {
    display: flex !important;
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    flex-direction: column;
    padding: 28px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
  .member-sidebar-user {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .member-sidebar-user .member-avatar { width: 38px; height: 38px; }
  .member-sidebar-user-name { font-size: 13px; font-weight: 600; }

  .member-sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
  }
  .member-sidebar-nav-item:hover  { background: var(--bg-surface); color: var(--text-primary); }
  .member-sidebar-nav-item.active {
    background: var(--brand-light);
    color: var(--brand);
    border-right: 3px solid var(--brand);
  }
  .member-sidebar-nav-item svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke: currentColor;
    flex-shrink: 0;
  }
  .member-sidebar-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 20px;
  }
  .member-sidebar-section-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 10px 20px 4px;
  }
  .member-sidebar-nav-item.site-link { font-size: 12px; color: var(--text-muted); }
  .member-sidebar-nav-item.site-link:hover { color: var(--text-primary); }
  .member-sidebar-nav-item.danger          { color: var(--danger); }
  .member-sidebar-nav-item.danger:hover    { background: var(--danger-light); }

  /* ---------- ヘッダー ---------- */
  .member-site-header { height: 60px; padding: 0 28px; }
  .member-logo-mark   { width: 32px; height: 32px; border-radius: 8px; }
  .member-logo-mark svg { width: 18px; height: 18px; }
  .member-logo-text   { font-size: 16px; }
  .member-logo-sub    { font-size: 9px; }
  .member-btn-ghost,
  .member-btn-solid   { height: 36px; padding: 0 16px; font-size: 12px; border-radius: 9px; }

  /* ---------- ページ構造 ---------- */
  .member-breadcrumb    { padding: 14px 28px 0; font-size: 12px; }
  .member-page-header   { padding: 18px 28px 0; }
  .member-page-title    { font-size: 26px; }
  .member-section-title { padding: 24px 28px 12px; }

  /* ---------- ユーザーカード ---------- */
  .member-user-card   { margin: 20px 28px 0; padding: 18px 20px; gap: 16px; }
  .member-avatar      { width: 52px; height: 52px; }
  .member-avatar svg  { width: 26px; height: 26px; }
  .member-user-name   { font-size: 16px; }
  .member-user-badge  { font-size: 11px; padding: 4px 10px; }

  /* ---------- フィルタースクロール ---------- */
  .member-filter-scroll {
    padding: 0 28px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  /* ---------- 書類リスト ---------- */
  .member-doc-list  { padding: 0 28px; gap: 10px; }
  .member-doc-item  { padding: 16px 18px; }
  .member-doc-name  { font-size: 14px; }

  /* ---------- マイページ グリッド ---------- */
  .member-mypage-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 28px 32px;
  }
  .member-mypage-card       { padding: 24px 16px 20px; }
  .member-mypage-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
  .member-mypage-card-icon  { width: 56px; height: 56px; border-radius: 16px; }
  .member-mypage-card-icon svg { width: 28px; height: 28px; }
  .member-mypage-card-label { font-size: 13px; }

  /* ---------- 外部ツール ---------- */
  .member-tools-tabs  { padding: 0 28px; }
  .member-tools-lead  { padding: 0 28px 20px; font-size: 14px; }
  .member-sys-list    { padding: 0 28px; gap: 12px; }
  .member-login-grid  { padding: 0 28px; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .member-login-card  { padding: 22px 14px 18px; }

  /* ---------- 見積もり / 試算結果 ---------- */
  .member-estimate-wrap,
  .member-result-wrap { padding: 0 28px 40px; max-width: 1000px; width: 100%; }

  /* ---------- 認証ページ ---------- */
  .member-auth-container   { max-width: 440px; padding: 40px 36px 36px; }
}


/* ==============================================
   マイページ ダッシュボード（ログイン済み）
   ============================================== */

/* クイックリンク グリッド */
.member-mypage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 16px 24px;
}

.member-mypage-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: var(--text-primary);
}
.member-mypage-card:active {
  transform: scale(0.97);
  box-shadow: none;
}

.member-mypage-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.member-mypage-card-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.member-mypage-card-icon.estimate { background: #EEF3FE; } .member-mypage-card-icon.estimate svg { stroke: var(--brand); }
.member-mypage-card-icon.price    { background: #FEF6E7; } .member-mypage-card-icon.price    svg { stroke: var(--warning); }
.member-mypage-card-icon.chat     { background: #E9F8F1; } .member-mypage-card-icon.chat     svg { stroke: var(--success); }
.member-mypage-card-icon.contract { background: var(--brand-light); } .member-mypage-card-icon.contract svg { stroke: var(--brand-mid); }
.member-mypage-card-icon.tools    { background: var(--bg-surface); border: 1px solid var(--border); } .member-mypage-card-icon.tools svg { stroke: var(--text-secondary); }

.member-mypage-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -0.1px;
  line-height: 1.3;
}

/* アニメーション */
.member-mypage-card:nth-child(1) { animation: memberFadeUp .3s ease both .10s; }
.member-mypage-card:nth-child(2) { animation: memberFadeUp .3s ease both .14s; }
.member-mypage-card:nth-child(3) { animation: memberFadeUp .3s ease both .18s; }
.member-mypage-card:nth-child(4) { animation: memberFadeUp .3s ease both .22s; }
.member-mypage-card:nth-child(5) { animation: memberFadeUp .3s ease both .26s; }




/* ==============================================
   認証ページ（未ログイン）
   ============================================== */

/* body 全体：白背景・縦横センタリング */
.member-auth-body {
  background: #f0f4f8;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Sans JP', -apple-system, 'Hiragino Sans', sans-serif;
}

/* ページラッパー */
.member-auth-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

/* ロゴ（画像） */
.member-auth-logo {
  display: block;
  text-align: center;
  margin-bottom: 24px;
  text-decoration: none;
}
.member-auth-logo img {
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* カードコンテナ */
.member-auth-container {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid #d8e0ec;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  padding: 36px 32px 32px;
}

/* タブ（下線スタイル） */
.member-auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.member-auth-tab {
  flex: 1;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  font-family: inherit;
  letter-spacing: -0.1px;
}
.member-auth-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.member-auth-tab:not(.active):hover {
  color: var(--text-secondary);
}

/* パネル */
.member-auth-panel {
  display: none;
}
.member-auth-panel.active {
  display: block;
  animation: memberFadeUp .2s ease both;
}

.member-auth-panel-inner {
  padding: 0;
}

.member-auth-lead {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* 会員登録 メリットリスト */
.member-register-benefits,
.member-auth-benefits {
  list-style: none;
  background: var(--brand-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.member-register-benefits li,
.member-auth-benefits li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}
.member-register-benefits-icon,
.member-auth-benefits-icon {
  width: 18px;
  height: 18px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== SWPM フォーム 共通上書き ===== */

/* ラベル */
.member-auth-panel label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-family: inherit;
}

/* インプット */
.member-auth-panel input[type="text"],
.member-auth-panel input[type="email"],
.member-auth-panel input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #d0d7e6;
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  background: #f8fafc;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 16px;
  display: block;
}
.member-auth-panel input[type="text"]:focus,
.member-auth-panel input[type="email"]:focus,
.member-auth-panel input[type="password"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20,96,200,0.1);
  outline: none;
  background: #fff;
}

/* チェックボックス */
.member-auth-panel input[type="checkbox"] {
  width: auto !important;
  height: auto !important;
  display: inline-block !important;
  margin: 0 5px 0 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  accent-color: var(--brand);
  vertical-align: middle;
}

/* 送信ボタン */
.member-auth-panel input[type="submit"] {
  width: 100%;
  height: 44px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  letter-spacing: 0.03em;
  font-family: inherit;
  transition: opacity var(--transition), box-shadow var(--transition);
  margin-top: 4px;
}
.member-auth-panel input[type="submit"]:hover {
  opacity: 0.88;
  box-shadow: 0 3px 10px rgba(20,96,200,0.3);
}

/* リンク（パスワードリセット等） */
.member-auth-panel a {
  color: var(--brand);
  font-size: 12px;
  text-decoration: none;
}
.member-auth-panel a:hover { text-decoration: underline; }

/* フォームの行間 */
.member-auth-panel p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* エラー・成功メッセージ */
.member-auth-panel .swpm_front_end_error_div,
.member-auth-panel .swpm-error-msg,
.member-auth-panel .swpm-red-error-text {
  display: block;
  background: var(--danger-light);
  border-left: 3px solid var(--danger);
  border-radius: 6px;
  padding: 9px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--danger);
  font-weight: normal;
}
.member-auth-panel .swpm-success-msg {
  background: var(--success-light);
  border-left: 3px solid var(--success);
  border-radius: 6px;
  padding: 9px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--success);
}
.member-auth-panel .swpm-login-action-msg {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 8px;
}

/* 姓・名 横並び */
.swpm-lastname-row,
.swpm-firstname-row {
  display: inline-block !important;
  width: calc(50% - 8px) !important;
  vertical-align: top;
  box-sizing: border-box;
  margin: 0 !important;
}
.swpm-lastname-row { margin-right: 16px !important; }
@media (max-width: 480px) {
  .swpm-lastname-row,
  .swpm-firstname-row {
    display: block !important;
    width: 100% !important;
    margin-right: 0 !important;
  }
}

/* サイトTOPリンク */
.member-auth-back {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
.member-auth-back a { color: var(--brand); text-decoration: none; }
.member-auth-back a:hover { text-decoration: underline; }


/* ==============================================
   外部ツールページ
   ============================================== */

/* ---------- タブ（ガイド / ログイン） ---------- */
.member-tools-tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 20px;
  animation: memberFadeUp .3s ease both .05s;
}
.member-tools-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 38px;
  border: 1.5px solid var(--border-strong);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.member-tools-tab svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.member-tools-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(20,96,200,0.25);
}
.member-tools-tab:not(.active):hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* タブコンテンツ */
.member-tools-panel { display: none; }
.member-tools-panel.active {
  display: block;
  animation: memberFadeUp .25s ease both;
}

/* ---------- セクションリード ---------- */
.member-tools-lead {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.75;
  padding: 0 16px 20px;
}

/* ---------- システムカード（ご案内タブ） ---------- */
.member-sys-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

.member-sys-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.member-sys-card:nth-child(1) { animation: memberFadeUp .3s ease both .08s; }
.member-sys-card:nth-child(2) { animation: memberFadeUp .3s ease both .13s; }
.member-sys-card:nth-child(3) { animation: memberFadeUp .3s ease both .18s; }
.member-sys-card:nth-child(4) { animation: memberFadeUp .3s ease both .23s; }

/* カードヘッダー */
.member-sys-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  user-select: none;
}
.member-sys-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.member-sys-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.member-sys-card-meta { flex: 1; min-width: 0; }
.member-sys-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-sys-type {
  font-size: 11px;
  color: var(--text-muted);
}
.member-sys-card-toggle {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}
.member-sys-card-toggle svg {
  width: 12px;
  height: 12px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: transform var(--transition);
}
.member-sys-card.open .member-sys-card-toggle svg {
  transform: rotate(180deg);
}
.member-sys-card.open .member-sys-card-toggle {
  background: var(--brand-light);
}
.member-sys-card.open .member-sys-card-toggle svg {
  stroke: var(--brand);
  transform: rotate(180deg);
}

/* カードボディ（アコーディオン） */
.member-sys-card-body {
  display: none;
  padding: 16px;
  border-top: 1px solid var(--border);
}
.member-sys-card.open .member-sys-card-body { display: block; }

.member-sys-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 14px;
}
.member-sys-features-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.member-sys-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.member-sys-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}
.member-sys-features-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-mid);
  flex-shrink: 0;
  margin-top: 6px;
}
.member-sys-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  text-decoration: none;
}
.member-sys-detail-link svg {
  width: 12px;
  height: 12px;
  stroke: var(--brand);
  fill: none;
  stroke-width: 2;
}
.member-sys-detail-link:hover { text-decoration: underline; }

/* ---------- ログインカード（ログインタブ） ---------- */
.member-login-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 16px;
}
.member-login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.member-login-card:nth-child(1) { animation: memberFadeUp .3s ease both .08s; }
.member-login-card:nth-child(2) { animation: memberFadeUp .3s ease both .13s; }
.member-login-card:nth-child(3) { animation: memberFadeUp .3s ease both .18s; }
.member-login-card:nth-child(4) { animation: memberFadeUp .3s ease both .23s; }

.member-login-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.member-login-card-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.member-login-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.member-login-card-type {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
}
.member-login-btn {
  display: block;
  width: 100%;
  padding: 9px 0;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  margin-top: 4px;
  transition: opacity var(--transition);
  font-family: inherit;
}
.member-login-btn:active { opacity: 0.8; }
.member-login-btn:hover  { opacity: 0.88; }

/* ==============================================
   見積もりフォーム・試算結果 共通ラッパー
   ============================================== */

/* ショートコード出力全体のラッパー */
.member-estimate-wrap,
.member-result-wrap {
  padding: 16px 16px 32px;
}

.logistics-calculator-container .container{
  padding: 0 15px;
}

/* ==============================================
   見積もりフォーム [logistics_form]
   ============================================== */

/* フォーム全体 */
.member-estimate-wrap form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---- セクション見出し ---- */
.member-estimate-wrap h2,
.member-estimate-wrap h3,
.member-estimate-wrap .section-title,
.member-estimate-wrap .form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--border);
}
.member-estimate-wrap h2:first-child,
.member-estimate-wrap h3:first-child {
  margin-top: 8px;
}

/* ---- フォーム行 ---- */
.member-estimate-wrap .form-row,
.member-estimate-wrap .form-group,
.member-estimate-wrap p {
  margin-bottom: 16px;
}

/* ---- ラベル ---- */
.member-estimate-wrap label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.4;
}

/* 必須バッジ */
.member-estimate-wrap label .required,
.member-estimate-wrap label .req,
.member-estimate-wrap .required-mark {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.5;
}

/* 任意バッジ */
.member-estimate-wrap label .optional {
  display: inline-block;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.5;
}

/* ---- テキスト / 数値 / メール / 日付 入力 ---- */
.member-estimate-wrap input[type="text"],
.member-estimate-wrap input[type="number"],
.member-estimate-wrap input[type="email"],
.member-estimate-wrap input[type="tel"],
.member-estimate-wrap input[type="date"],
.member-estimate-wrap input[type="url"] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.member-estimate-wrap input[type="text"]:focus,
.member-estimate-wrap input[type="number"]:focus,
.member-estimate-wrap input[type="email"]:focus,
.member-estimate-wrap input[type="tel"]:focus,
.member-estimate-wrap input[type="date"]:focus,
.member-estimate-wrap input[type="url"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
  background: var(--bg-card);
  outline: none;
}

/* 単位付きインプット（例: 〜件、〜円） */
.member-estimate-wrap .input-with-unit {
  display: flex;
  align-items: center;
  gap: 6px;
}
.member-estimate-wrap .input-with-unit input {
  flex: 1;
}
.member-estimate-wrap .input-unit {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- セレクトボックス ---- */
.member-estimate-wrap select {
  width: 100%;
  height: 50px;
  padding: 0 36px 0 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  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='%239BA3B8' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.member-estimate-wrap select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
  background-color: var(--bg-card);
  outline: none;
}

/* ---- テキストエリア ---- */
.member-estimate-wrap textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  box-sizing: border-box;
  resize: vertical;
  line-height: 1.6;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.member-estimate-wrap textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
  background: var(--bg-card);
  outline: none;
}

/* ---- ラジオ / チェックボックス ---- */
.member-estimate-wrap .radio-group,
.member-estimate-wrap .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.member-estimate-wrap .radio-group.inline,
.member-estimate-wrap .checkbox-group.inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}

.member-estimate-wrap .radio-item,
.member-estimate-wrap .checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.member-estimate-wrap input[type="radio"],
.member-estimate-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}

.member-estimate-wrap .radio-label,
.member-estimate-wrap .checkbox-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 0;
  cursor: pointer;
}

/* ラジオ・チェックを横並びカードに（クラス付与時） */
.member-estimate-wrap .choice-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.member-estimate-wrap .choice-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.member-estimate-wrap .choice-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand);
}

/* ---- ヘルプテキスト ---- */
.member-estimate-wrap .help-text,
.member-estimate-wrap .form-note,
.member-estimate-wrap small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* ---- エラーメッセージ ---- */
.member-estimate-wrap .error-message,
.member-estimate-wrap .form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}
.member-estimate-wrap .has-error input,
.member-estimate-wrap .has-error select,
.member-estimate-wrap .has-error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-light);
}

/* ---- 2カラムグリッド（PC） ---- */
.member-estimate-wrap .form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ---- 送信ボタン ---- */
.member-estimate-wrap input[type="submit"],
.member-estimate-wrap button[type="submit"],
.member-estimate-wrap .submit-btn {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  letter-spacing: 0.04em;
  font-family: inherit;
  margin-top: 24px;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.member-estimate-wrap input[type="submit"]:hover,
.member-estimate-wrap button[type="submit"]:hover,
.member-estimate-wrap .submit-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(20,96,200,0.3);
}
.member-estimate-wrap input[type="submit"]:active,
.member-estimate-wrap button[type="submit"]:active {
  transform: none;
  opacity: 0.78;
}
.member-estimate-wrap input[type="submit"]:disabled,
.member-estimate-wrap button[type="submit"]:disabled {
  background: var(--border-strong);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 1;
}

/* ---- ステップ表示（複数ステップフォーム用） ---- */
.member-estimate-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 16px 20px;
  overflow-x: auto;
}
.member-estimate-step {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.member-estimate-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.member-estimate-step.active   .member-estimate-step-dot { background: var(--brand);    color: #fff; }
.member-estimate-step.done     .member-estimate-step-dot { background: var(--success);  color: #fff; }
.member-estimate-step-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
  white-space: nowrap;
}
.member-estimate-step.active .member-estimate-step-label { color: var(--brand);   font-weight: 600; }
.member-estimate-step.done   .member-estimate-step-label { color: var(--success); }
.member-estimate-step-connector {
  width: 32px;
  height: 1.5px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}
.member-estimate-step.done + .member-estimate-step .member-estimate-step-connector,
.member-estimate-step-connector.done { background: var(--success); }


/* ==============================================
   試算結果 [logistics_result]
   ============================================== */

/* ---- 結果ヘッダー ---- */
.member-result-wrap .result-header,
.member-result-wrap .result-intro {
  background: var(--brand-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  border-left: 3px solid var(--brand);
}

/* ---- 合計金額 強調表示 ---- */
.member-result-wrap .result-total,
.member-result-wrap .total-price,
.member-result-wrap .estimate-total {
  background: var(--bg-card);
  border: 2px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-lg);
}
.member-result-wrap .result-total-label,
.member-result-wrap .total-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.member-result-wrap .result-total-amount,
.member-result-wrap .total-amount {
  font-size: 32px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.member-result-wrap .result-total-note,
.member-result-wrap .total-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- 内訳テーブル ---- */
.member-result-wrap table,
.member-result-wrap .result-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 13px;
}
.member-result-wrap table th {
  background: var(--bg-surface);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}
.member-result-wrap table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.member-result-wrap table tr:last-child td {
  border-bottom: none;
}
.member-result-wrap table tr:hover td {
  background: var(--bg-surface);
}
/* 金額列は右揃え */
.member-result-wrap table td:last-child,
.member-result-wrap table th:last-child {
  text-align: right;
}

/* ---- 内訳カード（テーブルの代替） ---- */
.member-result-wrap .breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.member-result-wrap .breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.member-result-wrap .breakdown-item-label {
  font-size: 13px;
  color: var(--text-secondary);
}
.member-result-wrap .breakdown-item-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---- 注意書き・補足 ---- */
.member-result-wrap .result-note,
.member-result-wrap .disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 20px;
}

/* ---- CTAボタン（問い合わせへ誘導など） ---- */
.member-result-wrap .result-cta,
.member-result-wrap .cta-area {
  margin-top: 8px;
}
.member-result-wrap .result-cta a,
.member-result-wrap .cta-btn {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--brand);
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  border-radius: 30px;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
}
.member-result-wrap .result-cta a:hover,
.member-result-wrap .cta-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(20,96,200,0.3);
}
.member-result-wrap .result-back,
.member-result-wrap .back-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--brand);
  text-decoration: none;
  margin-top: 14px;
}
.member-result-wrap .result-back:hover { text-decoration: underline; }




/* ==============================================
   デスクトップ コンテンツ幅 補正
   ============================================== */

/* ショートコード内の独自コンテナを幅いっぱいに広げる */
@media (min-width: 768px) {

  /* 見積もりフォーム・結果 内の全要素を幅100%に */
  .member-estimate-wrap > *,
  .member-result-wrap   > * {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
  }

  /* ショートコード独自のラッパーDiv（よくあるクラス名を網羅） */
  .member-estimate-wrap .logistics-form-wrap,
  .member-estimate-wrap .estimate-form-wrap,
  .member-estimate-wrap .logistics-wrap,
  .member-estimate-wrap .form-wrap,
  .member-estimate-wrap .lf-wrap,
  .member-estimate-wrap > div,
  .member-result-wrap   .logistics-result-wrap,
  .member-result-wrap   .result-wrap,
  .member-result-wrap   .lr-wrap,
  .member-result-wrap   > div {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  /* フォーム本体 */
  .member-estimate-wrap form { width: 100%; }

  /* フォームカード（白い囲み）がある場合も幅いっぱいに */
  .member-estimate-wrap .form-section,
  .member-estimate-wrap .form-card,
  .member-estimate-wrap .step-content,
  .member-estimate-wrap .logistics-section {
    width: 100%;
    max-width: none;
  }

  /* ステップインジケーターも全幅 */
  .member-estimate-wrap .step-indicator,
  .member-estimate-wrap .steps-wrap,
  .member-estimate-wrap .progress-steps {
    width: 100%;
    max-width: none;
  }

  /* フォームフィールドをデスクトップで2カラムに（可能な場合） */
  .member-estimate-wrap .form-fields-grid,
  .member-estimate-wrap .fields-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  /* ページ本文エリアもフル幅 */
  .member-main-area .member-page-body {
    padding: 12px 28px 0;
    font-size: 14px;
  }
}




/* ==============================================
   料金表ページ
   ============================================== */

/* 外側ラッパー */
.member-price-content {
  padding: 16px 16px 48px;
}

/* WordPress が出力する .member_price_area ラッパー */
.member-price-content .member_price_area {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---------- セクション ---------- */
.member-price-content .member_price_area section {
  margin-bottom: 36px;
}
.member-price-content .member_price_area section:last-of-type {
  margin-bottom: 16px;
}

/* ---------- セクション見出し h4 ---------- */
.member-price-content .member_price_area h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 10px 14px;
  border-left: 4px solid var(--brand);
  border-radius: 0 6px 6px 0;
  margin-bottom: 12px;
  line-height: 1.4;
}

/* ---------- 説明文 ---------- */
.member-price-content .member_price_area p:not(.note) {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 10px;
}

/* ---------- テーブル スクロールラッパー ---------- */
.member-table-scroll-wrap {
  margin-bottom: 12px;
}

/* テーブル：通常のテーブルレイアウト（PC・スマホ共通） */
.member-price-content .member_price_area table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 10px 0 0 0;
}

/* カスタムスクロールバーはスマホのみ表示 */
.member-table-scrollbar { display: none; }

/* スマホ：ラッパーをスクロールコンテナにしてテーブルを横スクロール */
@media (max-width: 767px) {
  .member-table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* ネイティブスクロールバーを細く表示 */
    scrollbar-width: thin;
    scrollbar-color: var(--brand-mid) var(--border);
  }
  .member-table-scroll-wrap::-webkit-scrollbar {
    height: 4px;
  }
  .member-table-scroll-wrap::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 4px;
  }
  .member-table-scroll-wrap::-webkit-scrollbar-thumb {
    background: var(--brand-mid);
    border-radius: 4px;
  }
  .member-price-content .member_price_area table {
    min-width: 520px; /* スマホで横スクロールが発生する最小幅 */
  }
}

/* section */
.member-price-content .member_price_area section {
  overflow-x: visible;
  position: relative;
}

/* ---------- テーブル ヘッダー ---------- */
.member-price-content .member_price_area thead tr {
  background: var(--brand-light);
}
.member-price-content .member_price_area th {
  padding: 11px 13px;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* 金額列（.price） */
.member-price-content .member_price_area th.price,
.member-price-content .member_price_area td.price {
  text-align: right;
  white-space: nowrap;
}
.member-price-content .member_price_area td.price {
  font-weight: 600;
  color: var(--brand);
  font-size: 13px;
}

/* 単位列（.unit） */
.member-price-content .member_price_area th.unit,
.member-price-content .member_price_area td.unit {
  text-align: center;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 11px;
}

/* ---------- テーブル データ行 ---------- */
.member-price-content .member_price_area td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: top;
  line-height: 1.55;
  font-size: 12px;
}
.member-price-content .member_price_area tbody tr:last-child td {
  border-bottom: none;
}
.member-price-content .member_price_area tbody tr:nth-child(even) td {
  background: var(--bg-surface);
}
/* 強調テキスト（td > strong） */
.member-price-content .member_price_area td strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
/* rowspan セル（越境EC対応など）の縦揃え */
.member-price-content .member_price_area td[rowspan] {
  vertical-align: middle;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
}

/* ---------- 注意書き p.note ---------- */
.member-price-content .member_price_area p.note,
.member-price-content p.note {
  background: var(--bg-surface);
  border-left: 3px solid var(--border-strong);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
}
.member-price-content .member_price_area p.note strong,
.member-price-content p.note strong {
  color: var(--text-secondary);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

/* ---------- 重要事項ボックス .important-notice ---------- */
.member-price-content .important-notice {
  background: var(--warning-light);
  border: 1px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 8px;
}
.member-price-content .important-notice p {
  font-size: 12px;
  color: var(--warning);
  line-height: 1.75;
  margin-bottom: 4px;
  padding-left: 14px;
  position: relative;
}
.member-price-content .important-notice p:last-child {
  margin-bottom: 0;
}
.member-price-content .important-notice p::before {
  content: '※';
  position: absolute;
  left: 0;
  font-size: 11px;
}

/* ---------- デスクトップ ---------- */
@media (min-width: 768px) {
  .member-price-content {
    padding: 16px 28px 56px;
  }

  /* デスクトップ：min-width 解除・カスタムスクロールバー非表示 */
  .member-price-content .member-swipe-hint { display: none; }
  .member-price-content .member_price_area section::after { display: none; }
  .member-price-content .member_price_area table {
    display: table;
    min-width: 0;
    overflow-x: visible;
    overflow-y: visible;
    margin-bottom: 12px;
  }
  .member-table-scrollbar { display: none !important; }

  .member-price-content .member_price_area h4 {
    font-size: 16px;
    padding: 2px 16px;
  }
  .member-price-content .member_price_area th {
    font-size: 12px;
    padding: 12px 16px;
  }
  .member-price-content .member_price_area td {
    font-size: 13px;
    padding: 13px 16px;
  }
  .member-price-content .member_price_area td.price { font-size: 14px; }
  .member-price-content .member_price_area td.unit  { font-size: 12px; }
  .member-price-content .member_price_area p.note,
  .member-price-content p.note {
    font-size: 13px;
    padding: 12px 16px;
  }
  .member-price-content .important-notice {
    padding: 16px 20px;
  }
  .member-price-content .important-notice p {
    font-size: 13px;
  }
}


/* ==============================================
   書類管理ページ（document-manager-v2 プラグイン上書き）
   member-portal のデザインシステムに統一
   ============================================== */

/* ---------- プラグイン CSS 変数をブランドカラーに上書き ---------- */
.dm-wrap {
  --dm-blue:        var(--brand);
  --dm-blue-light:  var(--brand-light);
  --dm-blue-mid:    var(--border-strong);
  --dm-border:      var(--border);
  --dm-text:        var(--text-primary);
  --dm-muted:       var(--text-muted);
  --dm-bg:          var(--bg-surface);
  --dm-white:       var(--bg-card);
  --dm-radius:      var(--radius-md);

  /* max-width を解除してメインエリア全幅に */
  max-width: none;
  margin: 0;
  font-family: 'Noto Sans JP', -apple-system, 'Hiragino Sans', sans-serif;
}

/* ---------- タブ：filter-tab と統一 ---------- */
.dm-tabs {
  border-bottom: none;
  gap: 6px;
  padding: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-bottom: 14px;
}
.dm-tab {
  height: 34px;
  padding: 0 12px;
  border-radius: 34px;
  border: 1.5px solid var(--border-strong) !important;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-bottom: 1.5px solid var(--border-strong) !important;
  margin-bottom: 0;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.dm-tab:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.dm-tab.active {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(20,96,200,0.25);
  font-weight: 600;
}
.dm-tab-count {
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-light);
  color: var(--brand);
}
.dm-tab.active .dm-tab-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ---------- テーブルラッパー ---------- */
.dm-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

/* ---------- テーブルヘッダー ---------- */
.dm-table thead tr {
  background: var(--bg-surface);
  border-bottom: 1.5px solid var(--border);
}
.dm-table th {
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* ---------- テーブルデータ行 ---------- */
.dm-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
}
.dm-row:last-child td { border-bottom: none; }
.dm-row:hover td { background: var(--brand-light); }

.dm-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.dm-row-note { color: var(--text-muted); font-size: 12px; }
.dm-row-date { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.dm-row-actions { text-align: right; white-space: nowrap; }

/* ---------- 種別バッジ ---------- */
.dm-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.dm-badge-estimate { background: var(--brand-light);   color: var(--brand); }
.dm-badge-contract { background: var(--success-light); color: var(--success); }
.dm-badge-invoice  { background: var(--warning-light); color: var(--warning); }
.dm-badge-other    { background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-secondary); }

/* ---------- ファイル形式バッジ ---------- */
.dm-ext-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}
.dm-ext-pdf  { background: var(--danger-light);  color: var(--danger); }
.dm-ext-xlsx,
.dm-ext-xls  { background: var(--success-light); color: var(--success); }
.dm-ext-csv  { background: var(--brand-light);   color: var(--brand); }
.dm-ext-zip  { background: #f3e8ff; color: #7c3aed; }

/* ---------- アクションボタン ---------- */
.dm-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  font-family: inherit;
}
.dm-btn-preview {
  background: var(--bg-card);
  color: var(--brand);
  border-color: var(--border-strong);
  margin-right: 6px;
}
.dm-btn-preview:hover {
  background: var(--brand-light);
  border-color: var(--brand);
}
.dm-btn-download {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.dm-btn-download:hover { opacity: 0.85; }
.dm-no-file { font-size: 11px; color: var(--text-muted); }

/* ---------- 空・未ログイン ---------- */
.dm-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.dm-login-notice {
  padding: 40px 20px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 13px;
}
.dm-login-notice a { color: var(--brand); text-decoration: underline; }

/* ---------- PDFプレビュー モーダル ---------- */
.dm-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.dm-overlay { position: absolute; inset: 0; background: rgba(15,20,40,0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.dm-modal-box {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: min(92vw, 860px);
  height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.dm-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}
.dm-modal-head h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.dm-close {
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: background var(--transition);
}
.dm-close:hover { background: var(--danger-light); color: var(--danger); }
.dm-modal-body { flex: 1; overflow: hidden; position: relative; }
#dm-pdf-frame  { width: 100%; height: 100%; border: none; display: block; }
.dm-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}
.dm-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: dm-spin .7s linear infinite;
}
@keyframes dm-spin { to { transform: rotate(360deg); } }
.dm-modal-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}
.dm-btn-dl-modal {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  padding: 9px 20px;
  font-size: 13px;
  border-radius: 8px;
}
.dm-btn-dl-modal:hover { opacity: 0.85; }

/* ---------- 書類ページラッパー ---------- */
.member-contract-content {
  padding: 16px 16px 40px;
}

/* ---------- デスクトップ ---------- */
@media (min-width: 768px) {
  .member-contract-content { padding: 16px 28px 48px; }

  .dm-tabs { flex-wrap: wrap; overflow-x: visible; }

  .dm-table th { padding: 11px 18px; font-size: 12px; }
  .dm-table td { padding: 15px 18px; font-size: 14px; }
  .dm-row-title { font-size: 14px; }
  .dm-row-note  { font-size: 13px; }
  .dm-row-date  { font-size: 13px; }
  .dm-btn { padding: 7px 14px; font-size: 12px; }
}

/* ---------- スマートフォン（480px以下）：カード形式を member-portal デザインに ---------- */
@media (max-width: 480px) {
  .dm-table-wrap { border: none; background: transparent; box-shadow: none; }
  .dm-table, .dm-table thead, .dm-table tbody,
  .dm-table th,  .dm-table td,  .dm-table tr { display: block; }
  .dm-table thead { display: none; }

  .dm-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
  }
  .dm-row:hover td   { background: transparent; }
  .dm-row:hover      { border-color: var(--brand-mid); }

  .dm-table td { border: none; padding: 0; margin-bottom: 6px; }
  .dm-table td:last-child { margin-bottom: 0; }

  .dm-col-note { display: block !important; }
  .dm-row-title { font-size: 14px; margin-bottom: 4px; }
  .dm-row-note  { max-width: 100%; font-size: 12px; }
  .dm-row-date  { font-size: 11px; }

  .dm-row-actions {
    text-align: left;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
  }
  .dm-btn {
    flex: 1;
    justify-content: center;
    padding: 9px 10px;
    font-size: 12px;
    border-radius: 8px;
  }
  .dm-btn-preview { margin-right: 0; }

  .dm-modal-box { width: 100vw; height: 100dvh; border-radius: 0; }
}


/* ==============================================
   チャットページ（[custom_chat_ui] スタイル上書き）
   JS・ショートコード関数には干渉しない
   ============================================== */

/* ---------- チャットページ専用ラッパー ---------- */
/* .member-page-wrapper の代わりに使用。縦いっぱい表示するため独自定義 */
.member-chat-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 52px - var(--nav-h) - var(--safe-bottom));
  overflow: hidden;
}
.member-chat-wrapper .member-breadcrumb  { flex-shrink: 0; }
.member-chat-wrapper .member-page-header { flex-shrink: 0; padding-bottom: 10px; }

.member-chat-body {
  flex: 1;
  overflow: hidden;
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* .chat-box */
.chat-box {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* ヘッダー */
#chat-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
#chat-head::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--success-light);
}

/* メッセージ一覧 */
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-page);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  min-height: 0;
}
#chat-messages::-webkit-scrollbar       { width: 4px; }
#chat-messages::-webkit-scrollbar-track { background: transparent; }
#chat-messages::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* ======================
   メッセージバブル
   JS出力のHTML構造:
   .chat-msg.other/.self
     .chat-bubble.other/.self
       .chat-avatar
       .chat-msgtext
         .chat-username
         (テキスト)
       .chat-time
   ====================== */

/* メッセージ行（幅制限） */
.chat-msg {
  display: block;
  max-width: 80%;
}
.chat-msg.self  { align-self: flex-end; }
.chat-msg.other { align-self: flex-start; }

/* バブル：グリッドでアバター｜コンテンツ の横並び */
.chat-bubble {
  display: grid;
  gap: 0 10px;
}

/* 相手メッセージ：アバター左・コンテンツ右 */
.chat-bubble.other {
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
}
.chat-bubble.other .chat-avatar {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: flex-end;
}
.chat-bubble.other .chat-msgtext {
  grid-column: 2;
  grid-row: 1;
}
.chat-bubble.other .chat-time {
  grid-column: 2;
  grid-row: 2;
  text-align: left;
}

/* 自分メッセージ：コンテンツ左・アバター右 */
.chat-bubble.self {
  grid-template-columns: 1fr 34px;
  grid-template-rows: auto auto;
}
.chat-bubble.self .chat-avatar {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: flex-end;
}
.chat-bubble.self .chat-msgtext {
  grid-column: 1;
  grid-row: 1;
}
.chat-bubble.self .chat-time {
  grid-column: 1;
  grid-row: 2;
  text-align: right;
}

/* アバター */
.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}
.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 送信者名（chat-msgtextの中にある） */
.chat-username {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
  display: block;
}

/* メッセージ本文 */
.chat-msgtext {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.65;
  word-break: break-word;
}
.chat-bubble.self .chat-msgtext {
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.self .chat-msgtext a { color: rgba(255,255,255,0.85); }

.chat-bubble.other .chat-msgtext {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-bubble.other .chat-msgtext a { color: var(--brand); }

/* システムメッセージ（先頭・sender_id=0）*/
.chat-msg.other:first-child .chat-msgtext {
  background: var(--brand-light);
  border-color: var(--border-strong);
}
.chat-bubble.other .chat-msgtext p { margin: 0 0 6px; }
.chat-bubble.other .chat-msgtext p:last-child { margin-bottom: 0; }
.chat-bubble.other .chat-msgtext strong { color: var(--brand); font-weight: 600; }

/* ファイルリンク */
.chat-msgtext a[href] {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  margin-top: 4px;
  text-decoration: underline;
}

/* 送信時刻 */
.chat-time {
  font-size: 10px;
  color: var(--text-muted);
  padding: 3px 2px 0;
  display: block;
}

/* 入力フォーム */
#chat-form {
  flex-shrink: 0;
  padding: 10px 12px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}
#chat-input {
  width: 100%;
  min-height: 100px !important;
  max-height: 120px;
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  resize: none;
  overflow-y: auto;
  line-height: 1.5;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
  display: block;
  margin-bottom: 8px;
}
#chat-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
  background: var(--bg-card);
  outline: none;
}
.chat_form_flex {
  display: flex;
  align-items: center;
  gap: 8px;
}
.file-input-wrapper {
  position: relative;
  flex-shrink: 0;
}
.file-input-wrapper input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.file-input-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 12px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition);
  user-select: none;
}
.file-input-button:hover {
  background: var(--bg-card);
  border-color: var(--brand);
  color: var(--brand);
}
#chat-form button[type="submit"] {
  flex: 1;
  height: 36px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition);
  white-space: nowrap;
}
#chat-form button[type="submit"]:hover    { opacity: 0.88; }
#chat-form button[type="submit"]:active   { opacity: 0.75; }
#chat-form button[type="submit"]:disabled { background: var(--border-strong); cursor: not-allowed; opacity: 1; }

/* デスクトップ */
@media (min-width: 768px) {
  .member-chat-wrapper { height: calc(100vh - 60px); }
  .member-chat-body    { padding: 0 28px 20px; }
  #chat-messages       { padding: 20px; gap: 20px; }
  .chat-msg            { max-width: 68%; }
  .chat-bubble.other   { grid-template-columns: 38px 1fr; }
  .chat-bubble.self    { grid-template-columns: 1fr 38px; }
  .chat-avatar         { width: 38px; height: 38px; }
  .chat-msgtext        { font-size: 14px; padding: 11px 15px; }
  #chat-input          { font-size: 14px; padding: 10px 14px; min-height: 44px; }
  #chat-form           { padding: 12px 16px; }
  .file-input-button   { height: 38px; font-size: 13px; }
  #chat-form button[type="submit"] { height: 38px; font-size: 14px; max-width: 100px; }
}

.member-auth-panel label{
  display: inline;
}

/* ---------- 見積もりフォーム：ラジオボタン PC 3列横並び ---------- */
@media (min-width: 768px) {
  .member-estimate-wrap .radio-group {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 12px;
  }
  .member-estimate-wrap .radio-group .radio-option {
    flex: 1;
    min-width: 0;
  }
}

/* =====================================================
   見積もりフォーム 追加修正
   ===================================================== */

/* --- nav-buttons：前へ戻る／次へ／見積もり実行ボタンのリセット ---
   member-portal の submit スタイル（width:100% / padding等）が
   プラグインボタンに干渉するのを防ぐ */
.member-estimate-wrap .nav-buttons .btn,
.member-estimate-wrap .nav-buttons button,
.member-estimate-wrap .nav-buttons input[type="submit"] {
  width: auto !important;
  flex: 0 0 auto !important;
  padding: 14px 28px !important;
  margin-top: 0 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border-radius: 30px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  -webkit-appearance: none;
  appearance: none;
}
.member-estimate-wrap .nav-buttons .btn-secondary {
  min-width: 120px;
  background: white !important;
  color: #003D6B !important;
  border: 2px solid #E5E5E5 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.member-estimate-wrap .nav-buttons .btn-secondary:hover {
  border-color: #0080FF !important;
  color: #0080FF !important;
  transform: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
}
.member-estimate-wrap .nav-buttons .btn-primary {
  min-width: 180px;
  background: #0080FF !important;
  color: white !important;
  border: none !important;
}
.member-estimate-wrap .nav-buttons .btn-primary:hover {
  background: #0066CC !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0,128,255,0.3) !important;
  opacity: 1 !important;
}

/* --- ラジオボタン：PC で 3列横並び ---
   member-portal の flex-direction:column を PC では row に上書き */
@media (min-width: 768px) {
  .member-estimate-wrap .radio-group {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 12px;
  }
  .member-estimate-wrap .radio-group .radio-option {
    flex: 1;
    min-width: 0;
  }
}

/* =====================================================
   見積もり結果テーブル スマホ最適化
   ===================================================== */
@media (max-width: 767px) {

  /* テーブルをカード形式に変換 */
  .member-result-wrap .results-table,
  .member-result-wrap .results-table thead,
  .member-result-wrap .results-table tbody,
  .member-result-wrap .results-table tr,
  .member-result-wrap .results-table th,
  .member-result-wrap .results-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  /* ヘッダー行を非表示 */
  .member-result-wrap .results-table thead { display: none; }

  /* 各行をカード化 */
  .member-result-wrap .results-table tbody tr {
    background: #fff;
    border: 1px solid #e4e9f2;
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(20,96,200,0.05);
  }
  .member-result-wrap .results-table tbody tr:hover { background: #f7f9fd; }

  /* 全セル共通：横並び（ラベル＋値） */
  .member-result-wrap .results-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 2px;
    font-size: 13px;
    border: none;
    text-align: right;
  }

  /* nth-child でラベルを疑似要素に */
  .member-result-wrap .results-table td::before {
    font-size: 11px;
    font-weight: 600;
    color: #9ba3b8;
    text-align: left;
    flex-shrink: 0;
    margin-right: 8px;
    min-width: 54px;
  }
  .member-result-wrap .results-table td:nth-child(1)::before { content: none; }
  .member-result-wrap .results-table td:nth-child(2)::before { content: "単価"; }
  .member-result-wrap .results-table td:nth-child(3)::before { content: "数量"; }
  .member-result-wrap .results-table td:nth-child(4)::before { content: "単位"; }
  .member-result-wrap .results-table td:nth-child(5)::before { content: "金額"; }

  /* 1列目（作業項目）は全幅タイトル */
  .member-result-wrap .results-table td:first-child {
    font-size: 14px;
    font-weight: 600;
    color: #1a1d23;
    justify-content: flex-start;
    padding-bottom: 8px;
    border-bottom: 1px solid #e4e9f2;
    margin-bottom: 4px;
  }

  /* 5列目（金額）を強調 */
  .member-result-wrap .results-table td:last-child {
    font-weight: 700;
    color: #1460c8;
    font-size: 14px;
  }

  /* 合計行 */
  .member-result-wrap .results-table .total-row {
    background: #e8f0fd !important;
    border-color: #1460c8 !important;
  }
  .member-result-wrap .results-table .total-row td { font-weight: 700; color: #003D6B; }
  .member-result-wrap .results-table .total-row td:last-child { font-size: 16px; color: #0080FF; }
}

/* =====================================================
   見積もりフォーム 追加修正（nav-buttons / ラジオ）
   ===================================================== */

.member-estimate-wrap .nav-buttons .btn,
.member-estimate-wrap .nav-buttons button,
.member-estimate-wrap .nav-buttons input[type="submit"] {
  width: auto !important;
  flex: 0 0 auto !important;
  padding: 14px 28px !important;
  margin-top: 0 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border-radius: 30px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  -webkit-appearance: none;
  appearance: none;
}
.member-estimate-wrap .nav-buttons .btn-secondary {
  min-width: 120px;
  background: white !important;
  color: #003D6B !important;
  border: 2px solid #E5E5E5 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.member-estimate-wrap .nav-buttons .btn-secondary:hover {
  border-color: #0080FF !important;
  color: #0080FF !important;
  transform: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
}
.member-estimate-wrap .nav-buttons .btn-primary {
  min-width: 180px;
  background: #0080FF !important;
  color: white !important;
  border: none !important;
}
.member-estimate-wrap .nav-buttons .btn-primary:hover {
  background: #0066CC !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0,128,255,0.3) !important;
  opacity: 1 !important;
}

/* ラジオボタン：PC で 3列横並び */
@media (min-width: 768px) {
  .member-estimate-wrap .radio-group {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 12px;
  }
  .member-estimate-wrap .radio-group .radio-option {
    flex: 1;
    min-width: 0;
  }
}

/* ==============================================
   料金ページ 会員登録CTA [member_pricing_cta]
   ============================================== */
.pricing-member-cta {
  background: linear-gradient(135deg, #1460C8 0%, #0a45a0 100%);
  border-radius: 16px;
  padding: 40px 32px;
  margin: 48px 0;
  color: #fff;
  text-align: center;
  font-family: 'Noto Sans JP', sans-serif;
}
.pricing-member-cta .cta-label {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.pricing-member-cta h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #fff;
  border: none;
  padding: 0;
}
.pricing-member-cta .cta-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 28px;
  line-height: 1.6;
}
.pricing-member-cta .cta-features {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.pricing-member-cta .cta-feature-item {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  padding: 14px 20px;
  min-width: 160px;
  flex: 1;
  max-width: 220px;
}
.pricing-member-cta .cta-feature-item .feature-icon {
  font-size: 24px;
  margin-bottom: 6px;
  display: block;
}
.pricing-member-cta .cta-feature-item .feature-name {
  font-size: 14px;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}
.pricing-member-cta .cta-feature-item .feature-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  display: block;
  line-height: 1.4;
}
.pricing-member-cta .cta-button {
  display: inline-block;
  background: #fff;
  color: #1460C8 !important;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 40px;
  border-radius: 50px;
  text-decoration: none !important;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  letter-spacing: 0.03em;
}
.pricing-member-cta .cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  color: #1460C8 !important;
}
.pricing-member-cta .cta-note {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  margin-top: 12px;
}
@media (max-width: 600px) {
  .pricing-member-cta { padding: 28px 20px; }
  .pricing-member-cta h3 { font-size: 18px; }
  .pricing-member-cta .cta-features { flex-direction: column; align-items: center; }
  .pricing-member-cta .cta-feature-item { max-width: 100%; width: 100%; }
  .pricing-member-cta .cta-button { padding: 14px 28px; font-size: 15px; }
}