/* ============================================
   料金シュミレーション — Design Tokens & Base
   Inspired by 誰でもスマホ (a-sas.ne.jp) tone
   ============================================ */

:root {
  /* サンシスコン Brand */
  --primary: #0068B7;        /* brand blue */
  --primary-2: #004D88;       /* shadow */
  --primary-50: #EBF4FF;      /* selected bg */
  --primary-100: #DCEAFC;
  --primary-bg: #F2F7FF;      /* page bg */
  --primary-gradient: linear-gradient(135deg, #0068B7 0%, #2A8DD8 100%);

  --accent: #F40C36;          /* red — alerts, sale */
  --accent-2: #DB1A1A;
  --accent-50: #FFEAEE;
  --accent-bg: #F7E5EF;

  --success: #1F8A5B;
  --success-50: #ECFFE8;
  --warn: #F4A521;

  --ink-0: #111111;
  --ink-1: #1F1F1F;
  --ink-2: #3D3D3D;
  --ink-3: #666666;
  --ink-4: #999999;
  --ink-5: #C0C0C0;
  --ink-6: #E0E0E0;
  --ink-7: #F0F0F4;
  --ink-8: #F7F8FA;
  --bg: #F2F7FF;
  --white: #FFFFFF;

  --divider: #E0E0E0;
  --divider-soft: #ECECEC;

  /* Type */
  --font-jp: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  --font-en: "Reddit Sans Condensed", "Inter", system-ui, sans-serif;

  /* Radius / shadow */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 999px;
  --shadow-sm: 0 1px 2px rgba(13, 13, 13, 0.06), 0 1px 1px rgba(13, 13, 13, 0.04);
  --shadow-md: 0 4px 12px rgba(13, 13, 13, 0.08);
  --shadow-lg: 0 10px 30px rgba(13, 13, 13, 0.12);
  --shadow-pop: 0 4px 0 rgba(13, 13, 13, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-jp);
  background: var(--bg);
  color: var(--ink-1);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================
   Top app shell
   ============================================ */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--ink-6);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink-0);
}
.app-brand .logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--primary-gradient);
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.app-brand .tagline { font-size: 11px; color: var(--ink-3); font-weight: 500; }

.view-switch {
  display: inline-flex;
  background: var(--ink-7);
  border-radius: var(--r-full);
  padding: 4px;
  margin-left: auto;
}
.view-switch button,
.view-switch a {
  padding: 7px 16px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
}
.view-switch button.active,
.view-switch a.active {
  background: #fff;
  color: var(--ink-0);
  box-shadow: var(--shadow-sm);
}
.view-switch svg { width: 14px; height: 14px; }

.app-meta {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* ============================================
   Stage (the area the view is rendered in)
   ============================================ */
.stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 800px 400px at 30% 0%, rgba(255, 128, 0, 0.06), transparent 70%),
    radial-gradient(ellipse 800px 400px at 70% 100%, rgba(255, 57, 88, 0.05), transparent 70%),
    var(--bg);
}

/* ---- Mobile bezel (frontend) ---- */
.mobile-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  width: 100%;
  flex-wrap: wrap;
}
.mobile-frame {
  width: 390px;
  height: 800px;
  background: #111;
  border-radius: 48px;
  padding: 12px;
  box-shadow: 0 30px 60px -20px rgba(13, 13, 13, 0.35), 0 0 0 1px rgba(0,0,0,0.05);
  flex-shrink: 0;
  position: relative;
}
.mobile-frame::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 28px;
  background: #000;
  border-radius: 16px;
  z-index: 3;
}
.mobile-screen {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 36px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.status-bar {
  height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 28px 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-0);
  flex-shrink: 0;
}
.status-bar .icons { display: inline-flex; gap: 5px; align-items: center; }

.frontend-side-info {
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: center;
}
.side-card {
  background: #fff;
  border-radius: var(--r-lg);
  border: 1px solid var(--ink-6);
  padding: 16px;
}
.side-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-0);
  display: flex; align-items: center; gap: 6px;
}
.side-card .badge { font-size: 10px; padding: 2px 8px; border-radius: var(--r-full); background: var(--accent-50); color: var(--accent); font-weight: 800; }
.side-card p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.side-card ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
.side-card kbd {
  display: inline-block;
  background: var(--ink-7);
  border: 1px solid var(--ink-6);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: var(--font-en);
  color: var(--ink-2);
}

/* ============================================
   Frontend — wizard inside the phone
   ============================================ */
.fe-header {
  padding: 8px 20px 12px;
  background: #fff;
  flex-shrink: 0;
  border-bottom: 1px solid var(--ink-7);
}
.fe-header-top { display: flex; align-items: center; justify-content: space-between; }
.fe-header-back {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-2);
}
.fe-header-back:hover { background: var(--ink-7); }
.fe-header-back:disabled { opacity: 0.3; cursor: default; }
.fe-header-title { font-size: 14px; font-weight: 800; color: var(--ink-0); }
.fe-header-step { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.fe-header-step .num { font-family: var(--font-en); font-weight: 700; color: var(--primary); }

.fe-progress {
  height: 4px;
  background: var(--ink-7);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-top: 10px;
}
.fe-progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--r-full);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.fe-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 140px;
  position: relative;
}
.fe-scroll::-webkit-scrollbar { width: 0; }

.fe-q-eyebrow {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.fe-q-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--ink-0);
  margin: 0 0 8px;
  text-wrap: pretty;
}
.fe-q-sub {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 0 0 22px;
}

.fe-options {
  display: flex;
  flex-direction: column;
  gap: 10px; 
  margin-bottom:15px;
}

.fe-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 16px;
  border: 2px solid rgba(255, 150, 50, 0.45);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #fff9f0 0%, #fff3e0 100%);
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
  position: relative;
}
.fe-option:hover { border-color: rgba(255, 150, 50, 0.75); }
.fe-option.selected {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 0 0 4px rgba(0, 104, 183, 0.08);
}
/* 3状態: グループ内で選択が確定したら、非選択肢は白に戻して「選択中(水色)」との区別を明確化。
   全くの未選択（グループに .selected が無い）ときは淡いオレンジのまま。:has() で実現。 */
/* コンテナ非依存（/・/reservation/・/multiple/ 共通）: 親が選択済みカードを直接持つとき、
   その兄弟の非選択カードを白に。/reservation/ はプランが素のdivなので *:has(>...) で対応。 */
*:has(> .fe-option.selected) > .fe-option:not(.selected):not(.fe-option-na),
*:has(> .rsp-plan-card.selected) > .rsp-plan-card:not(.selected),
*:has(> .device-item-card--selected) > .device-item-card:not(.device-item-card--selected) {
  background: #fff;
  border-color: var(--ink-6);
  box-shadow: none;
}
*:has(> .fe-option.selected) > .fe-option:not(.selected):not(.fe-option-na):hover,
*:has(> .rsp-plan-card.selected) > .rsp-plan-card:not(.selected):hover,
*:has(> .device-item-card--selected) > .device-item-card:not(.device-item-card--selected):hover {
  border-color: var(--ink-5);
  background: var(--ink-8);
}
.fe-option-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--ink-7);
  display: grid; place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.fe-option.selected .fe-option-icon {
  background: #fff;
}
.fe-option-text { flex: 1; min-width: 0; }
.fe-option-title { font-size: 15px; font-weight: 700; color: var(--ink-0); }
.fe-option-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.fe-option-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--ink-5);
  display: grid; place-items: center;
  flex-shrink: 0;
  background: #fff;
}
.fe-option.selected .fe-option-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.addon-price-regular {
  font-size: 11px;
  color: var(--ink-4);
  text-decoration: line-through;
  line-height: 1.4;
}
.addon-price-promo {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.4;
}

.fe-option .badge-tag {
  position: absolute;
  top: -8px; right: 14px;
  font-size: 10px;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

/* 最大キャンペーン割引バッジ（プレミアム強調・目立たせる） */
.badge-tag.maxcamp-badge,
.fe-option .badge-tag.maxcamp-badge {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(120deg, #E01047 0%, #FF5E3A 52%, #FFB020 100%);
  padding: 3px 10px;
  box-shadow: 0 3px 12px rgba(224, 16, 71, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  position: relative;
  overflow: hidden;
  animation: maxcampPulse 2.4s ease-in-out infinite;
  z-index: 2;
}
.fe-option .badge-tag.maxcamp-badge::after {
  content: "";
  position: absolute;
  top: 0; left: -70%;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  transform: skewX(-20deg);
  animation: maxcampShine 2.8s ease-in-out infinite;
}
@keyframes maxcampPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes maxcampShine {
  0%, 15% { left: -70%; }
  70%, 100% { left: 140%; }
}
@media (prefers-reduced-motion: reduce) {
  .fe-option .badge-tag.maxcamp-badge { animation: none; }
  .fe-option .badge-tag.maxcamp-badge::after { display: none; animation: none; }
}

/* プラン別: 表示ON＋選択不可のオプション（押すとアラート） */
.fe-option.fe-option-na {
  opacity: 0.6;
  background: var(--ink-8);
  border-color: var(--ink-6);
}
.fe-option.fe-option-na .fe-option-title { color: var(--ink-3); }
.fe-option .fe-option-na-tag {
  position: absolute;
  top: -8px; left: 14px;
  font-size: 10px;
  font-weight: 800;
  background: var(--ink-3);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--r-full);
}
/* プラン別: 選択不可をタップした時のアラート */
.fe-addon-alert {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--accent);
  background: var(--accent-50);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.payment-option-badges {
  position: absolute;
  top: -8px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  max-width: 72%;
  z-index: 1;
}
.payment-option-badges .badge-tag {
  position: static;
}
.payment-option-badges--rsp {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  max-width: 65%;
  z-index: 2;
}

/* Slider option */
.fe-slider-card {
  background: #fff;
  border: 2px solid var(--ink-6);
  border-radius: var(--r-lg);
  padding: 22px 18px;
}
.fe-slider-value {
  font-family: var(--font-en);
  font-size: 56px;
  font-weight: 700;
  color: var(--ink-0);
  line-height: 1;
  text-align: center;
  letter-spacing: -0.02em;
}
.fe-slider-value .unit { font-size: 22px; color: var(--ink-3); margin-left: 4px; font-weight: 600; }
.fe-slider-sub { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.fe-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--ink-6);
  border-radius: var(--r-full);
  margin-top: 22px;
  outline: none;
}
.fe-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  background: #fff;
  border: 4px solid var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.fe-slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-en);
}

/* Checkbox option set */
.fe-check {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 2px solid var(--ink-6);
  border-radius: var(--r-lg);
  background: #fff;
  width: 100%;
  text-align: left;
}
/* 単独トグル（充電器など・他に選択肢がない）はオフ=白／オン=水色。オレンジの強調は付けない */
.fe-check.selected { border-color: var(--primary); background: var(--primary-50); }
.fe-check-box {
  width: 22px; height: 22px;
  border: 2px solid var(--ink-5);
  border-radius: 6px;
  display: grid; place-items: center;
  background: #fff;
}
.fe-check.selected .fe-check-box { background: var(--primary); border-color: var(--primary); color: #fff; }
.fe-check-meta { font-size: 12px; color: var(--ink-3); }
.fe-check-meta .price { color: var(--ink-0); font-weight: 800; font-family: var(--font-en); }

/* Bottom action bar */
.fe-actions {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 20px 22px;
  background: linear-gradient(to top, #fff 78%, rgba(255,255,255,0));
  display: flex; gap: 10px;
  flex-shrink: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 52px;
  border-radius: var(--r-full);
  font-weight: 800;
  font-size: 15px;
  padding: 0 22px;
  transition: transform 0.06s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  flex: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 0 var(--accent-2);
}
.btn-primary:disabled {
  background: var(--ink-5);
  box-shadow: 0 4px 0 var(--ink-6);
  cursor: not-allowed;
  color: #fff;
}
.btn-ghost {
  background: var(--ink-7);
  color: var(--ink-1);
  flex: 0 0 52px;
  padding: 0;
}

/* ============================================
   Frontend — Result screen
   ============================================ */
.fe-result-hero {
  padding: 22px 20px;
  background:#F2F7FE;
  position: relative;
  overflow: hidden;
}
.fe-result-hero::after {
  display:none;
  content: "";
  position: absolute;
  right: -40px; bottom: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,128,0,0.18), transparent 70%);
  border-radius: 50%;
}
.fe-result-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background:var(--primary);
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 800;
  color:#fff;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.fe-result-plan-name { font-size: 24px; font-weight: 900; color: var(--ink-0); line-height: 1.3; margin: 0; }
.fe-result-plan-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.fe-result-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 16px;
  font-family: var(--font-en);
}
.fe-result-price .amount { font-size: 52px; font-weight: 700; color: var(--accent); line-height: 1; letter-spacing: -0.03em; }
.fe-result-price .unit { font-size: 18px; color: var(--ink-2); font-weight: 600; }
.fe-result-price .tax { font-size: 11px; color: var(--ink-3); font-family: var(--font-jp); }

.fe-result-breakdown {
  padding: 15px 15px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fe-result-breakdown h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-0);
  margin: 0;
  display: flex; align-items: center; gap: 6px;
}
.fe-breakdown-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--ink-6);
  border-radius: var(--r-md);
  overflow: hidden;
}
.fe-breakdown-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  font-size: 13px;
  background: #fff;
  border-bottom: 1px solid var(--ink-7);
}
.fe-breakdown-row:last-child { border-bottom: none; }
.fe-breakdown-row.total { background: var(--ink-8); font-weight: 800; }
.fe-breakdown-row .label { color: var(--ink-2); }
.fe-breakdown-row .label .desc { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
.fe-breakdown-row .val { font-family: var(--font-en); font-weight: 700; color: var(--ink-0); }
.fe-breakdown-row.total .val { color: var(--accent); font-size: 17px; }
.fe-breakdown-row .val.minus { color: var(--success); }
.fe-breakdown-row .val.plus { color: var(--accent); }

/* サンクスページ（専用URL） */
.thanks-page-screen {
  min-height: 100%;
  background: var(--bg);
}
.thanks-page-screen .fe-scroll {
  flex: 1;
  overflow-y: auto;
}

/* ===================== サンクスページ (劇的リニューアル) ===================== */
.tx-hero {
  position: relative;
  overflow: hidden;
  padding: 40px 20px 34px;
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,255,255,0.25), transparent 60%),
    linear-gradient(160deg, #0068B7 0%, #1F8A5B 130%);
  color: #fff;
}
.tx-hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 26px;
  background: var(--bg);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
/* 紙吹雪 */
.tx-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tx-confetti i {
  position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px;
  opacity: 0; animation: tx-confetti 2.6s ease-in forwards;
}
@keyframes tx-confetti {
  0%   { transform: translateY(-12px) rotate(0deg); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translateY(360px) rotate(620deg); opacity: 0; }
}
/* 成功チェック */
.tx-check-wrap { position: relative; width: 92px; height: 92px; margin: 0 auto 6px; }
.tx-check-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.55);
  animation: tx-ring 1.4s ease-out 0.2s infinite;
}
.tx-check-badge {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(255,255,255,0.16);
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  animation: tx-pop 0.5s cubic-bezier(0.22,1.2,0.36,1) both;
}
.tx-check-badge svg { width: 56px; height: 56px; }
.tx-check-circle { stroke: #fff; stroke-width: 3.2; fill: none; stroke-dasharray: 151; stroke-dashoffset: 151; animation: tx-draw 0.5s ease-out 0.35s forwards; }
.tx-check-mark   { stroke: #fff; stroke-width: 4;   fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 44; stroke-dashoffset: 44; animation: tx-draw 0.35s ease-out 0.75s forwards; }
@keyframes tx-pop  { 0% { transform: scale(0); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes tx-ring { 0% { transform: scale(0.7); opacity: 0.7; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes tx-draw { to { stroke-dashoffset: 0; } }

/* 本体カード群 */
.tx-body { padding: 4px 16px 20px; }
.tx-fade { animation: tx-fade-up 0.5s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes tx-fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.tx-card {
  background: #fff; border: 1px solid var(--ink-6); border-radius: 14px;
  padding: 16px; margin-bottom: 12px; text-align: left;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.tx-card-title { font-size: 12px; font-weight: 800; color: var(--ink-2); letter-spacing: .04em; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

/* 受付番号 */
.tx-receipt {
  background: linear-gradient(135deg, #EAF4FF, #EAFBF1);
  border: 1px solid rgba(0,104,183,0.18);
}
.tx-receipt-no { font-family: var(--font-en); font-size: 24px; font-weight: 800; color: var(--ink-0); letter-spacing: .04em; word-break: break-all; }
.tx-copy-btn {
  flex-shrink: 0; border: 1px solid var(--primary); color: var(--primary); background: #fff;
  border-radius: 8px; font-size: 11px; font-weight: 800; padding: 7px 12px; cursor: pointer;
  transition: all .15s;
}
.tx-copy-btn.copied { background: var(--success); border-color: var(--success); color: #fff; }

/* タイムライン */
.tx-timeline { position: relative; }
.tx-step { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.tx-step:last-child { padding-bottom: 0; }
.tx-step::before {
  content: ""; position: absolute; left: 17px; top: 38px; bottom: -2px; width: 2px;
  background: linear-gradient(var(--primary), rgba(0,104,183,0.15));
}
.tx-step:last-child::before { display: none; }
.tx-step-badge {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #0068B7, #2A8DD8); color: #fff;
  display: grid; place-items: center; font-size: 17px; z-index: 1;
  box-shadow: 0 4px 12px rgba(0,104,183,0.3);
}
.tx-step-no { font-family: var(--font-en); font-size: 10px; font-weight: 800; color: var(--primary); letter-spacing: .1em; }
.tx-step-title { font-size: 14px; font-weight: 800; color: var(--ink-0); margin: 1px 0 4px; }
.tx-step-desc { font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.tx-step-note { font-size: 10.5px; color: var(--accent-2); line-height: 1.6; margin-top: 5px; padding-left: 14px; text-indent: -14px; }

/* サポート */
.tx-support { background: linear-gradient(135deg, #FFF8E8, #FFF1E6); border: 1px solid rgba(244,165,33,0.25); }


/* プランデータ内訳（基本+増量+回復） */
.plan-data-breakdown {
  margin-top: 8px;
  padding: 6px 8px;
  /* 未選択時はカードの淡いオレンジに合わせる（同系色の薄いオレンジ面） */
  background: rgba(255, 150, 50, 0.10);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}
.plan-data-breakdown__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 0;
}
.plan-data-breakdown__label {
  color: var(--ink-3);
  font-weight: 600;
}
.plan-data-breakdown__label small {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: var(--ink-4);
  margin-top: 1px;
}
.plan-data-breakdown__val {
  font-family: var(--font-en);
  font-size:14px;
  font-weight: 800;
  color: var(--ink-1);
  white-space: nowrap;
}
.plan-data-breakdown__val.accent { color: var(--accent); }
.plan-data-breakdown__val.primary { color: var(--primary); }
.plan-data-breakdown__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--ink-6);
  font-weight: 800;
  color: var(--ink-0);
}
.plan-data-breakdown__total strong {
  font-family: var(--font-en);
  font-size: 13px;
}
.plan-data-breakdown__note {
  margin: 6px 0 0;
  font-size: 9px;
  color: var(--ink-4);
  line-height: 1.5;
}
.rsp-plan-card.selected .plan-data-breakdown {
  background: rgba(0, 104, 183, 0.06);
}
/* 3状態: グループ内で選択が確定したら、非選択カードの内訳は既存のグレー(--ink-8)に戻す。
   全くの未選択時のみ淡いオレンジ。:has() でカードの3状態と同じ挙動に揃える。 */
*:has(> .rsp-plan-card.selected) > .rsp-plan-card:not(.selected) .plan-data-breakdown {
  background: var(--ink-8);
}

/* 端末価格・割引表示 */
.device-price-block {
  margin: 10px 14px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--ink-7);
  border-radius: 10px;
}
.device-price-block--selected {
  border-color: rgba(0, 104, 183, 0.25);
  box-shadow: 0 2px 8px rgba(0, 104, 183, 0.08);
}
.device-price-block__campaign {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.device-price-block__campaign-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.35;
}
.device-price-block__sale {
  font-family: var(--font-en);
  font-size: 24px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
}
.device-price-block__sale small {
  font-family: var(--font-jp);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  margin-left: 2px;
}
.device-price-discount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #fff4ee 0%, #ffe8dc 55%, #fff9f5 100%);
  border: 1.5px solid rgba(255, 57, 88, 0.35);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(255, 57, 88, 0.1);
}
.device-price-block--selected .device-price-discount {
  background: linear-gradient(135deg, #fff0f3 0%, #ffe0e8 100%);
  border-color: rgba(255, 57, 88, 0.5);
}
.device-price-discount__main {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}
.device-price-discount__tag {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.4;
}
.device-price-discount__amount {
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
}
.device-price-discount__amount small {
  font-family: var(--font-jp);
  font-size: 12px;
  font-weight: 800;
  margin-left: 1px;
}
.device-price-discount__off {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.device-price-discount__pct {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--success);
  background: var(--success-50);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.device-price-block__regular {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top:10px;
  margin-top:10px;
  border-top: 1px dashed var(--ink-6);
}
.device-price-block__regular-label {
  font-size: 11px;
  color: var(--ink-3);
}
.device-price-block__regular-val {
  font-family: var(--font-en);
  font-size: 13px;
  color: var(--ink-4);
  text-decoration: line-through;
}
.device-price-block__regular-val small {
  font-family: var(--font-jp);
  font-size: 10px;
  margin-left: 1px;
}

/* 端末一覧 — スマホ1列 / PC 2列 */
.device-item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 768px) {
  .device-item-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
  }
  .device-item-list > .device-item-card {
    min-width: 0;
  }
}
.device-item-card {
  border: 2px solid rgba(255, 150, 50, 0.45);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff9f0 0%, #fff3e0 100%);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.device-item-card:not(.device-item-card--selected):hover { border-color: rgba(255, 150, 50, 0.75); }
.device-item-card--selected {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 2px 10px rgba(0, 104, 183, 0.1);
}
.device-item-card--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.device-item-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 8px;
  flex-shrink: 0;
}
.device-item-card__radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ink-5);
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.device-item-card--selected .device-item-card__radio {
  border-color: var(--primary);
}
.device-item-card__radio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}
.device-item-card__title {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-0);
  line-height: 1.3;
  min-width: 0;
  letter-spacing: 0.02em;
}
.device-item-card__stock {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: var(--ink-4);
  padding: 2px 7px;
  border-radius: 99;
  flex-shrink: 0;
}
.device-item-card__body {
  padding: 0 14px 12px;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.device-item-card__heading {
  display: grid;
  grid-template-columns: minmax(88px, 120px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}
.device-item-card__heading--sim {
  grid-template-columns: minmax(72px, 100px) minmax(0, 1fr);
}
.device-item-card__img {
  border-radius: 8px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.device-item-card__img img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  display: block;
}
.device-item-card__sim-note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
}
.device-item-card__spec {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  border-radius: 6px;
  overflow: hidden;
}
.device-item-card__spec li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.45;
  padding: 4.5px 8px;
  margin: 0;
}
.device-item-card__spec li:nth-child(odd) {
  background: var(--ink-8);
}
.device-item-card__spec li:nth-child(even) {
  background: #fff;
}
.device-item-card__spec li svg {
  flex-shrink: 0;
  color: var(--ink-3);
}
.device-item-card__spec li span:last-child {
  min-width: 0;
  flex: 1;
}
.device-item-card__price .device-price-block {
  margin: 12px 0 0;
}
.device-item-card__free {
  margin: 12px 0 0;
  padding: 12px;
  background: var(--success-50);
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
}
.device-item-card__banner {
  margin-top: auto;
  padding: 12px 14px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  line-height: 1.45;
  flex-shrink: 0;
}
.device-item-card--selected .device-item-card__banner {
  background: var(--primary-2);
}

.device-discount-preview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #fff4ee, #fff9f5);
  border: 1px dashed var(--accent);
  border-radius: 8px;
  font-size: 12px;
}
.device-discount-preview__label {
  color: var(--ink-3);
  font-weight: 600;
}
.device-discount-preview strong {
  font-family: var(--font-en);
  font-size: 16px;
  color: var(--accent);
}
.device-discount-preview__pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
}

.fe-compare {
  padding: 0 20px 100px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fe-compare-title { font-size: 13px; font-weight: 800; color: var(--ink-0); margin: 8px 0; }
.fe-compare-card {
  border: 1px solid var(--ink-6);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
}
.fe-compare-card .name { font-size: 13px; font-weight: 700; color: var(--ink-1); }
.fe-compare-card .sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.fe-compare-card .price { font-family: var(--font-en); font-weight: 700; font-size: 18px; color: var(--ink-0); }
.fe-compare-card .price small { font-size: 11px; color: var(--ink-3); font-family: var(--font-jp); margin-left: 1px; }

/* ============================================
   Admin Panel
   ============================================ */
.admin-shell {
  width: 100%;
  max-width: 1480px;
  background: #fff;
  border-radius: var(--r-lg);
  border: 1px solid var(--ink-6);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
  min-height: 820px;
}

.admin-sidebar {
  background: #0F1115;
  color: #C8CCD1;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}
.admin-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  padding-bottom: 8px;
}
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 10px;
  flex: 1;
  min-width: 0;
}
.admin-sidebar-close {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.06);
  color: #C8CCD1;
  flex-shrink: 0;
  margin-top: 4px;
}
.admin-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.admin-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}
.admin-nav-scroll::-webkit-scrollbar { width: 4px; }
.admin-nav-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* ハンバーガー（狭い画面のみ表示） */
.admin-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--ink-8);
  border: 1px solid var(--ink-6);
  color: var(--ink-1);
  flex-shrink: 0;
  place-items: center;
}
.admin-nav-toggle:hover { background: var(--ink-7); }

.admin-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(17, 17, 17, 0.45);
  border: none;
  padding: 0;
  cursor: pointer;
}
.admin-sidebar-brand .logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary-gradient);
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-en); font-weight: 800;
}
.admin-sidebar-brand .name { font-size: 13px; font-weight: 800; color: #fff; }
.admin-sidebar-brand .role { font-size: 10px; color: #6E7480; }

.admin-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6E7480;
  padding: 14px 10px 6px;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #C8CCD1;
  width: 100%;
  text-align: left;
}
.admin-nav-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.admin-nav-item.active { background: rgba(0, 104, 183, 0.18); color: #fff; box-shadow: inset 2px 0 0 var(--primary); }
.admin-nav-item svg { width: 16px; height: 16px; }
.admin-nav-item .count { margin-left: auto; font-size: 10px; background: rgba(255,255,255,0.08); padding: 1px 7px; border-radius: var(--r-full); font-family: var(--font-en); font-weight: 700; }
.admin-nav-item.active .count { background: var(--primary); }

.admin-user {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}
.admin-user .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-gradient); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.admin-user .name { font-size: 12px; color: #fff; font-weight: 700; }
.admin-user .role { font-size: 10px; color: #6E7480; }
.admin-reset-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #C8CCD1;
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.admin-reset-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.admin-reset-btn svg { width: 14px; height: 14px; }

.admin-main {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.admin-topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--ink-6);
  padding: 0 28px;
  display: flex; align-items: center; gap: 16px;
  flex-shrink: 0;
}
.admin-breadcrumb { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.admin-breadcrumb .current { color: var(--ink-0); font-weight: 700; }
.admin-search {
  margin-left: auto;
  width: 280px;
  height: 36px;
  background: var(--ink-8);
  border-radius: var(--r-full);
  border: 1px solid var(--ink-6);
  padding: 0 14px 0 36px;
  font-size: 13px;
  position: relative;
}
.admin-search-wrap { position: relative; margin-left: auto; }
.admin-search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 14px; height: 14px; }
.admin-search-wrap .admin-search { margin: 0; }

.admin-icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-full);
  background: var(--ink-8);
  display: grid; place-items: center;
  color: var(--ink-2);
  border: 1px solid var(--ink-6);
  position: relative;
}
.admin-icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; }
.admin-icon-btn svg { width: 16px; height: 16px; }

.admin-content {
  padding: 24px 28px 40px;
  overflow-y: auto;
  flex: 1;
}

/* Admin page header */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
}
.page-head h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  color: var(--ink-0);
}
.page-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.page-head-actions { display: flex; gap: 8px; }

/* 新管理ページ（クーポン/請求/FAQ/問い合わせ/エラー等）: .admin-page-head / .admin-table を
   既存の .page-head / .tbl と同等に装飾（CSS未定義で無装飾＝レイアウト崩れになっていたのを修正）。 */
.admin-page-head {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px; margin-bottom: 18px;
}
.admin-page-head h1 { font-size: 22px; font-weight: 800; margin: 0; color: var(--ink-0); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left; font-size: 11px; font-weight: 700; color: var(--ink-3);
  padding: 9px 10px; border-bottom: 1px solid var(--ink-6); background: var(--ink-8); white-space: nowrap;
}
.admin-table td {
  padding: 11px 10px; border-bottom: 1px solid var(--ink-7); color: var(--ink-1); vertical-align: middle;
}
.admin-table tr:hover td { background: var(--ink-8); }

.btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--ink-6);
  background: #fff;
  color: var(--ink-1);
}
.btn-sm:hover { background: var(--ink-8); }
.btn-sm.primary { background: var(--ink-0); color: #fff; border-color: var(--ink-0); }
.btn-sm.primary:hover { background: var(--ink-1); }
.btn-sm.pop { background: var(--primary-gradient); color: #fff; border-color: transparent; }
.btn-sm.pop:hover { filter: brightness(1.05); }
/* 選択中トグル（曜日指定・配信先・テンプレ選択など btn-sm active を使う全箇所の選択状態） */
.btn-sm.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.btn-sm.active:hover { background: var(--primary); filter: brightness(1.06); }
.btn-sm svg { width: 14px; height: 14px; }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  background: #fff;
  border: 1px solid var(--ink-6);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.kpi-label { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; display: flex; align-items: center; gap: 6px; }
.kpi-label svg { width: 12px; height: 12px; }
.kpi-value { font-family: var(--font-en); font-size: 30px; font-weight: 700; color: var(--ink-0); letter-spacing: -0.02em; margin-top: 6px; line-height: 1; }
.kpi-value .unit { font-size: 14px; color: var(--ink-3); margin-left: 4px; font-weight: 600; }
.kpi-delta { font-size: 11px; font-weight: 700; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-en); }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--accent); }
.kpi-spark { margin-top: 8px; height: 32px; }

/* Two-col grids */
.split-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.split-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.panel {
  background: #fff;
  border: 1px solid var(--ink-6);
  border-radius: var(--r-md);
  padding: 18px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 800; color: var(--ink-0); }
.panel-head .meta { font-size: 11px; color: var(--ink-3); }
.panel-tabs { display: inline-flex; background: var(--ink-8); border-radius: var(--r-md); padding: 3px; }
.panel-tabs button { font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 6px; color: var(--ink-3); }
.panel-tabs button.active { background: #fff; color: var(--ink-0); box-shadow: var(--shadow-sm); }

/* Tables */
table tr th,
table tr td{
  font-size:14px;
  font-weight:600;
}

@media screen and (max-width:768px){

table tbody tr td:first-child span{display:block;}

}


.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--ink-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink-6);
  background: var(--ink-8);
}
.tbl td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--ink-7);
  color: var(--ink-1);
  vertical-align: middle;
}
/* ログ系テーブル: 複数行の内容セルで行が伸びたとき、日時/バッジ/操作ボタンが行中央に浮いて
   バラバラに見えるのを防ぐ（上揃え）。使用側は className="tbl tbl--top" を指定。 */
.tbl--top td { vertical-align: top; }
.tbl tr:hover td { background: var(--ink-8); }
.tbl .row-main { font-weight: 700; color: var(--ink-0); }
.tbl .row-sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.tbl .pill {
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill.green { background: var(--success-50); color: var(--success); }
.pill.gray { background: var(--ink-7); color: var(--ink-3); }
.pill.red { background: var(--accent-50); color: var(--accent); }
.pill.blue { background: var(--primary-50); color: var(--primary); }
.pill.yellow { background: #FFF6DD; color: #B27800; }

.tbl .price { font-family: var(--font-en); font-weight: 700; color: var(--ink-0); }
.tbl .actions { display: inline-flex; gap: 4px; justify-content: flex-end; width: 100%; }
.tbl .ic-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--ink-3);
}
.tbl .ic-btn:hover { background: var(--ink-7); color: var(--ink-0); }
.tbl .ic-btn svg { width: 14px; height: 14px; }

.toggle {
  width: 36px; height: 20px;
  background: var(--ink-6);
  border-radius: var(--r-full);
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle::after {
  content: ""; position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: var(--shadow-sm);
}
.toggle.on { background: var(--success); }
.toggle.on::after { transform: translateX(16px); }

/* Chart */
.chart {
  position: relative;
  height: 240px;
  margin-top: 8px;
}
.chart svg { width: 100%; height: 100%; display: block; }

/* Log feed */
.log-list { display: flex; flex-direction: column; gap: 0; }
.log-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--ink-7);
  align-items: center;
}
.log-row:last-child { border: none; }
.log-time { font-size: 11px; color: var(--ink-3); font-family: var(--font-en); font-weight: 600; }
.log-summary { font-size: 12px; color: var(--ink-1); }
.log-summary strong { font-weight: 800; }
.log-cv { font-size: 11px; padding: 2px 8px; border-radius: var(--r-full); font-weight: 800; }
.log-cv.yes { background: var(--success-50); color: var(--success); }
.log-cv.drop { background: var(--ink-7); color: var(--ink-3); }

/* Flow builder */
.flow-canvas {
  background:
    radial-gradient(circle, var(--ink-6) 1px, transparent 1px) 0 0 / 16px 16px,
    var(--ink-8);
  border-radius: var(--r-md);
  border: 1px solid var(--ink-6);
  padding: 24px;
  min-height: 480px;
  position: relative;
}
.flow-node {
  position: absolute;
  background: #fff;
  border: 2px solid var(--ink-6);
  border-radius: var(--r-md);
  padding: 12px 14px;
  width: 200px;
  box-shadow: var(--shadow-sm);
}
.flow-node.start { border-color: var(--success); background: var(--success-50); }
.flow-node.end { border-color: var(--accent); background: var(--accent-50); }
.flow-node.q { border-color: var(--primary); background: var(--primary-50); }
.flow-node.q.selected { border-color: var(--primary); background: var(--primary); }
.flow-node.q.selected .flow-node-type,
.flow-node.q.selected .flow-node-title,
.flow-node.q.selected .flow-node-meta { color: #fff; }
.flow-node-type { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 4px; }
.flow-node.start .flow-node-type { color: var(--success); }
.flow-node.end .flow-node-type { color: var(--accent); }
.flow-node.q .flow-node-type { color: var(--primary); }
.flow-node-title { font-size: 13px; font-weight: 700; color: var(--ink-0); line-height: 1.3; }
.flow-node-meta { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

/* ===== Flow builder v2 (upgraded) ===== */
.fb-note {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-2); line-height: 1.5;
  background: var(--primary-50);
  border: 1px solid var(--primary-50);
  border-radius: var(--r-md);
  padding: 9px 12px; margin-bottom: 14px;
}
.fb-note svg { width: 15px; height: 15px; color: var(--primary); flex-shrink: 0; }
.fb-dirty { color: var(--accent); font-weight: 700; margin-left: 8px; }

.fb-canvas-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fb-canvas-title { font-size: 13px; font-weight: 800; color: var(--ink-1); }

.fb-canvas { display: flex; flex-direction: column; align-items: center; padding: 20px 16px; }

.fb-node {
  width: 100%; max-width: 380px;
  background: #fff; border: 1.5px solid var(--ink-6);
  border-radius: var(--r-md); padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.fb-node-start, .fb-node-end { text-align: center; }
.fb-node-start { border-color: var(--success); background: var(--success-50); }
.fb-node-end { border-color: var(--accent); background: var(--accent-50); }
.fb-node-type { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 3px; }
.fb-node-start .fb-node-type { color: var(--success); }
.fb-node-end .fb-node-type { color: var(--accent); }
.fb-node-title { font-size: 13px; font-weight: 700; color: var(--ink-0); line-height: 1.3; }
.fb-node-meta { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

.fb-node-q { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.fb-node-q:hover { border-color: var(--primary); }
.fb-node-q.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.fb-node-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.fb-step-badge { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; background: var(--primary); color: #fff; font-family: var(--font-en); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.fb-node-body { min-width: 0; }
.fb-node-body .fb-node-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-node-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fb-tag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: var(--r-full); background: var(--ink-7); color: var(--ink-2); white-space: nowrap; }
.fb-tag.req { background: var(--accent-50); color: var(--accent); }
.fb-tag.opt { background: var(--ink-7); color: var(--ink-3); }
.fb-tag.cond { background: #FFF6DD; color: #B27800; }

.fb-node-actions { display: flex; gap: 2px; flex-shrink: 0; }
.fb-ic { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--ink-3); border: 1px solid transparent; flex-shrink: 0; background: transparent; cursor: pointer; }
.fb-ic:hover { background: var(--ink-7); color: var(--ink-0); }
.fb-ic.danger:hover { background: var(--accent-50); color: var(--accent); }
.fb-ic:disabled { opacity: .3; cursor: not-allowed; }
.fb-ic:disabled:hover { background: transparent; color: var(--ink-3); }
.fb-ic svg { width: 14px; height: 14px; }

.fb-connector { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px 0; }
.fb-connector-line { width: 2px; height: 18px; background: repeating-linear-gradient(to bottom, var(--ink-5) 0 3px, transparent 3px 6px); }
.fb-branch-pill { font-size: 10px; font-weight: 700; color: #B27800; background: #FFF6DD; border: 1px solid #FCE9B8; border-radius: var(--r-full); padding: 2px 8px; text-align: center; }

.fb-help { font-size: 11px; color: var(--ink-3); line-height: 1.5; }

.fb-choices { display: flex; flex-direction: column; gap: 6px; }
.fb-choice { display: flex; align-items: center; gap: 6px; background: var(--ink-8); border: 1px solid var(--ink-7); border-radius: 6px; padding: 4px 6px; }
.fb-choice-num { width: 18px; height: 18px; flex-shrink: 0; background: var(--ink-6); border-radius: 4px; display: grid; place-items: center; font-family: var(--font-en); font-size: 10px; font-weight: 800; color: var(--ink-1); }
.fb-choice input { flex: 1; min-width: 0; height: 30px; border: none; background: transparent; font-size: 12px; font-weight: 600; padding: 0 4px; color: var(--ink-0); }
.fb-choice input:focus { outline: none; }

.fb-section { border-top: 1px solid var(--ink-7); padding-top: 12px; margin-top: 2px; }
.fb-cond { background: var(--ink-8); border: 1px solid var(--ink-7); border-radius: 8px; padding: 10px; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.fb-cond-row { display: flex; gap: 6px; }
.fb-cond-row select, .fb-cond-row input { height: 34px; border: 1px solid var(--ink-6); border-radius: 6px; font-size: 12px; padding: 0 8px; background: #fff; flex: 1; min-width: 0; color: var(--ink-0); }
.fb-cond-preview { font-size: 11px; font-weight: 700; color: var(--primary); }

/* Live preview (right panel) */
.fb-preview { padding: 2px; }
.fb-preview-frame { background: linear-gradient(180deg, #fff, var(--ink-8)); border: 1px solid var(--ink-6); border-radius: 16px; padding: 18px 16px; box-shadow: var(--shadow-sm); }
.fb-preview-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.fb-preview-title { font-size: 16px; font-weight: 800; color: var(--ink-0); margin-top: 6px; line-height: 1.35; }
.fb-preview-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.fb-preview-body { margin-top: 14px; }
.fb-preview-list { display: flex; flex-direction: column; gap: 8px; }
.fb-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fb-preview-opt { border: 1.5px solid var(--ink-6); border-radius: 10px; padding: 12px; font-size: 13px; font-weight: 700; color: var(--ink-1); background: #fff; }
.fb-preview-opt.row { display: flex; align-items: center; gap: 10px; }
.fb-preview-mark { width: 18px; height: 18px; flex-shrink: 0; border: 2px solid var(--ink-5); }
.fb-preview-mark.dot { border-radius: 50%; }
.fb-preview-mark.box { border-radius: 5px; }
.fb-preview-ticks { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; color: var(--ink-3); font-family: var(--font-en); flex-wrap: wrap; gap: 2px; }
.fb-preview-devgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fb-preview-dev { border: 1px solid var(--ink-6); border-radius: 10px; padding: 8px; text-align: center; background: #fff; }
.fb-preview-dev-img { height: 46px; border-radius: 6px; background: var(--ink-7); margin-bottom: 6px; }
.fb-preview-dev-name { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.fb-preview-cta { width: 100%; margin-top: 16px; height: 44px; border-radius: 12px; background: var(--primary-gradient); color: #fff; font-size: 14px; font-weight: 800; border: none; opacity: .85; }

/* Field editor (right drawer) */
.field-group { display: flex; flex-direction: column; gap: 12px; }
.field-row { display: flex; flex-direction: column; gap: 6px; }
.field-row label { font-size: 11px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; }
.field-row input, .field-row select, .field-row textarea {
  height: 38px;
  border: 1px solid var(--ink-6);
  border-radius: var(--r-sm);
  padding: 0 12px;
  font-size: 13px;
  background: #fff;
}
.field-row input:focus, .field-row select:focus, .field-row textarea:focus {
  outline: none;
  border-color: var(--ink-0);
}
.field-row textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
.field-row .help { font-size: 11px; color: var(--ink-3); }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Logic rule */
.rule-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px dashed var(--ink-5);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  font-size: 12px;
}
.rule-row .pill-input {
  background: #fff;
  border: 1px solid var(--ink-6);
  border-radius: var(--r-full);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}
.rule-row .op { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.rule-row .arrow { color: var(--ink-4); }

/* Device cards */
.device-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.device-card {
  background: #fff;
  border: 1px solid var(--ink-6);
  border-radius: var(--r-md);
  padding: 14px;
  position: relative;
}
.device-card .img-ph {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--ink-8), var(--ink-7));
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  margin-bottom: 10px;
  color: var(--ink-4);
  font-size: 32px;
  position: relative;
}
.device-card .device-name { font-size: 13px; font-weight: 800; color: var(--ink-0); }
.device-card .device-sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.device-card .device-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.device-card .device-price { font-family: var(--font-en); font-weight: 700; font-size: 16px; color: var(--ink-0); }
.device-card .stock-pill { font-size: 10px; padding: 2px 8px; border-radius: var(--r-full); font-weight: 800; }

/* Reusable */
.spacer-12 { height: 12px; }
.spacer-20 { height: 20px; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Single-page mode tweaks: hide per-step Step badge eyebrows */
.single-page .fe-q-eyebrow { display: none; }
.single-page .fe-q-title { font-size: 16px; margin-bottom: 6px; }
.single-page .fe-q-sub { font-size: 12px; margin-bottom: 14px; }

/* シミュレーション — 本文のみスクロール、フッター常時表示 */
.single-page.mobile-screen,
.mobile-screen.sim-sticky-footer {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  max-height: 100%;
}
.single-page .fe-header,
.mobile-screen.sim-sticky-footer .status-bar {
  flex-shrink: 0;
}
.single-page .fe-scroll,
.mobile-screen.sim-sticky-footer .sim-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.single-page .fe-scroll {
  padding: 16px 14px 0;
}
.single-page [id^="fsec-"] {
  scroll-margin-top: 8px;
  scroll-margin-bottom: 168px;
}
.mobile-screen.sim-sticky-footer .sim-scroll-body {
  padding: 16px 14px 200px;
}
.single-page .sim-bottom-bar,
.mobile-screen.sim-sticky-footer .sim-bottom-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  flex-shrink: 0;
  z-index: 30;
  margin-top: auto;
}
.sim-sticky-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  height: 100%;
}
.sim-sticky-inner > *:not(.sim-scroll-body):not(.sim-bottom-bar) {
  flex-shrink: 0;
}
.mobile-screen.sim-sticky-footer > .sim-sticky-outer {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================
   Standalone Pages (各画面が独立したルートで動作)
   /  → 料金シミュレーション
   /reservation/ → 来店予約
   /portal/      → 代理店ポータル
   /admin/       → 管理画面
   ============================================ */
.standalone-page {
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
}
.standalone-page--sim {
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  height: 100dvh;
  max-height: 100dvh;
  background:
    radial-gradient(ellipse 800px 400px at 30% 0%, rgba(255, 128, 0, 0.06), transparent 70%),
    radial-gradient(ellipse 800px 400px at 70% 100%, rgba(255, 57, 88, 0.05), transparent 70%),
    var(--bg);
}
.standalone-page--full {
  min-height: 100dvh;
}

/* シミュレーション本体の枠 — モバイルでフル幅 / PC で中央寄せ */
.standalone-sim-frame {
  width: 100%;
  position: relative;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.standalone-sim-frame .mobile-screen {
  border-radius: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.standalone-page--sim .status-bar { display: none; }

/* PC: 中央カラム（料金シミュ・来店予約共通）— ビューポート内でフッター固定 */
@media (min-width: 768px) {
  .standalone-page--sim {
    padding: 24px 16px;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    box-sizing: border-box;
  }
  .standalone-sim-frame {
    max-width: min(960px, 100%);
    width: 100%;
    height: 100%;
    max-height: 100%;
    margin-left: auto;
    margin-right: auto;
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(13, 13, 13, 0.08);
  }
  .standalone-sim-frame .mobile-screen {
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }
}

/* 代理店ポータル standalone — portalRoot の absolute を打ち消す */
.standalone-page--full .portal-root {
  position: static;
  inset: auto;
  min-height: 100dvh;
}

/* 管理画面 standalone — admin-shell の最大幅を解除し全幅で */
.standalone-page--full .admin-shell {
  max-width: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  min-height: 100dvh;
}

/* ============================================
   Admin: 共通新規UI (Drawer / Toast / Hint / etc.)
   ============================================ */

/* Drawer */
.admin-drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.5);
  display: flex;
  justify-content: flex-end;
  z-index: 200;
  animation: fadeIn 0.15s ease;
}
.admin-drawer {
  width: min(520px, 100vw);
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  animation: drawerSlide 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.18);
}
@keyframes drawerSlide {
  from { transform: translateX(40px); opacity: 0.6; }
  to   { transform: translateX(0); opacity: 1; }
}
.admin-drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--ink-6);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.admin-drawer-eyebrow {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.admin-drawer-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink-0);
  margin-top: 2px;
}
.admin-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 99px;
  background: var(--ink-7);
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--ink-2);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.admin-drawer-close:hover { background: var(--ink-6); }
.admin-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}
.admin-drawer-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--ink-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--ink-8);
}

/* Toast */
.admin-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  background: var(--ink-0);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  text-align: left;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 10000; /* モーダル(zIndex:9999)より前面に */
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  animation: toastIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.admin-toast > span { flex-shrink: 0; line-height: 1.6; }
.admin-toast--ok span { color: var(--success); }
.admin-toast--warn { background: var(--accent); }
.admin-toast--warn span { color: #fff; }
@keyframes toastIn {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}

/* Hint Box */
.hint-box {
  padding: 12px 14px;
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--ink-1);
  line-height: 1.7;
}
.hint-box code {
  background: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-en);
  font-size: 11px;
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--ink-3);
  border: 1px dashed var(--ink-5);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}

/* Toggle row */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--ink-7);
  gap: 14px;
}
.toggle-row-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-0);
}
.toggle-row-help {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 1px;
}

/* Field section label (in drawer) */
.field-section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* Button danger variant */
.btn-sm.danger {
  color: var(--accent);
  border-color: var(--accent-50);
  background: #fff;
}
.btn-sm.danger:hover {
  background: var(--accent-50);
}

/* Table scroll wrap */
.tbl-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Detail list (in drawer) */
.detail-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ink-6);
  border-radius: var(--r-md);
  overflow: hidden;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 13px;
  background: #fff;
  border-bottom: 1px solid var(--ink-7);
  gap: 16px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row > span { color: var(--ink-3); font-weight: 600; flex-shrink: 0; }
.detail-row > b { font-weight: 800; color: var(--ink-0); }

/* ============================================
   Analysis Page
   ============================================ */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.funnel-row {
  display: grid;
  grid-template-columns: 200px 1fr 56px 64px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.funnel-label {
  color: var(--ink-2);
  font-weight: 700;
}
.funnel-bar {
  background: var(--ink-7);
  border-radius: 6px;
  overflow: hidden;
  height: 26px;
  position: relative;
}
.funnel-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0068B7, #2A8DD8);
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding-left: 10px;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.funnel-bar-value {
  color: #fff;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 12px;
}
.funnel-pct {
  text-align: right;
  font-family: var(--font-en);
  font-weight: 800;
  color: var(--ink-0);
}
.funnel-drop {
  text-align: right;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 11px;
  color: var(--ink-3);
}
.funnel-drop.warn { color: var(--accent); }
.funnel-drop.first { color: var(--success); }

.device-mix {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 6px;
}
.device-mix-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.device-mix-row .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dropoff-row {
  display: grid;
  grid-template-columns: 28px 1fr 160px 72px 56px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.dropoff-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink-7);
  color: var(--ink-2);
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 11px;
}
.dropoff-reason { font-size: 13px; color: var(--ink-1); font-weight: 600; }
.dropoff-bar {
  height: 8px;
  background: var(--ink-7);
  border-radius: 99px;
  overflow: hidden;
  display: block;
}
.dropoff-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #F40C36, #FF8A6E);
  border-radius: 99px;
}
.dropoff-count { font-family: var(--font-en); font-weight: 700; font-size: 12px; color: var(--ink-2); text-align: right; }
.dropoff-pct { font-family: var(--font-en); font-weight: 800; font-size: 13px; color: var(--accent); text-align: right; }

/* ============================================
   Wi-Fi Page
   ============================================ */
.wifi-device-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ink-6);
  border-radius: var(--r-md);
  background: #fff;
}
.wifi-device-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--ink-7);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 22px;
  overflow: hidden;
}
.wifi-device-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ============================================
   レスポンシブ (Admin 拡張部分)
   ============================================ */
@media (max-width: 1024px) {
  .funnel-row {
    grid-template-columns: 1fr 56px 64px;
  }
  .funnel-label {
    grid-column: 1 / -1;
    margin-bottom: -2px;
  }
  .dropoff-row {
    grid-template-columns: 24px 1fr 56px;
    grid-template-rows: auto auto;
  }
  .dropoff-reason { grid-column: 2 / 3; }
  .dropoff-bar { grid-column: 2 / 3; grid-row: 2; }
  .dropoff-count { display: none; }
  .dropoff-pct { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 768px) {
  .admin-drawer {
    width: 100vw;
  }
  .device-mix {
    flex-direction: column;
    align-items: stretch;
  }
  .device-mix svg {
    align-self: center;
  }
}

/* ============================================
   Responsive — PC / Tablet / Mobile
   (参考: sunsyscon.com/contract/set-mobile/plan/)
   ============================================ */

html { overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }

/* --- Responsive grid utilities (inline grid 回避) --- */
.rsp-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rsp-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rsp-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rsp-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.rsp-grid-7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.rsp-grid-mnp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rsp-grid-birth { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.rsp-grid-device { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 4px 14px; align-items: center; }
/* Plan card — shared by /reservation and / Step3Plan */
.rsp-plan-card {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 2px solid rgba(255, 150, 50, 0.45);
  background: linear-gradient(135deg, #fff9f0 0%, #fff3e0 100%);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.rsp-plan-card.selected {
  border-color: var(--primary);
  box-shadow: inset 4px 0 0 var(--primary);
  background: rgba(0, 104, 183, 0.05);
}
.rsp-plan-card:not(.selected):hover {
  border-color: rgba(255, 150, 50, 0.75);
  background: linear-gradient(135deg, #fff5e8 0%, #ffedd5 100%);
}
.rsp-plan-badge {
  position: absolute;
  top: -1px;
  right: 10px;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 0 0 6px 6px;
  letter-spacing: 0.04em;
  line-height: 1.6;
}
.rsp-plan-badges {
  position: absolute;
  top: -1px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
  max-width: 72%;
  z-index: 1;
}
.rsp-plan-badges .rsp-plan-badge {
  position: static;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.rsp-plan-boost {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  border-radius: 20px;
  padding: 3px 8px;
  background: var(--ink-8);
  transition: background 0.15s;
}
.rsp-plan-card.selected .rsp-plan-boost { background: rgba(0, 104, 183, 0.08); }
.rsp-radio-row { display: grid; grid-template-columns: 1fr; gap: 8px; }

/* --- PC simulation layout --- */
.pc-sim {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: 820px;
}
.pc-sim-main {
  border-right: 1px solid var(--ink-6);
  display: flex;
  flex-direction: column;
}
.pc-sim-hero {
  background: linear-gradient(135deg, #0068B7 0%, #003C73 100%);
  color: #fff;
  padding: 32px 40px;
  position: relative;
  overflow: hidden;
}
.pc-sim-body {
  padding: 32px 40px 40px;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.pc-sim-aside {
  background: var(--ink-8);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: 820px;
}
.pc-sim-plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pc-sim-radio-grid { display: grid; gap: 6px; }
.pc-sim-radio-grid--2 { grid-template-columns: repeat(2, 1fr); }
.pc-sim-radio-grid--3 { grid-template-columns: repeat(3, 1fr); }
.pc-sim-radio-grid--4 { grid-template-columns: repeat(4, 1fr); }
.pc-sim-section--full { grid-column: 1 / -1; }

/* --- Agency portal --- */
.portal-root {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #F2F7FF 0%, #FFFFFF 60%);
  overflow: auto;
  z-index: 30;
}
.portal-root--app { background: var(--bg); }
.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: #fff;
  border-bottom: 1px solid var(--ink-6);
  gap: 12px;
  flex-wrap: wrap;
}
.portal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 32px;
  background: #fff;
  border-bottom: 1px solid var(--ink-6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.portal-content { padding: 24px 32px 60px; }
.portal-kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.portal-login-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 880px;
  margin: 0 auto 60px;
  padding: 0 20px;
}
.portal-settings-grid { display: grid; grid-template-columns: 1fr 320px; gap: 22px; }
.portal-settings-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }

/* --- Stage padding per view --- */
.stage { padding: 24px; }
.stage--frontend { padding: 24px; }
.stage--portal { padding: 0; }
.stage--admin { padding: 18px; }
.stage--reservation { padding: 24px; }

/* PC sim modal */
.pc-sim-modal-box {
  background: #fff;
  border-radius: 14px;
  padding: 32px;
  width: min(480px, calc(100% - 32px));
  text-align: center;
}

/* --- Bottom sticky bar (simulation) --- */
.sim-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--ink-6);
  padding: 10px 14px 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.04);
}
.sim-price-strip {
  display: flex;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--ink-6);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.sim-price-strip > div {
  flex: 1 1 0%;
  min-width: 0;
}
.sim-price-strip > button[type="button"] {
  flex: 0 0 auto;
  min-width: 52px;
}
.sim-price-amount {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-en);
  letter-spacing: -0.02em;
  transition: color 0.2s ease, transform 0.2s ease;
}
.sim-price-amount--flash {
  animation: sim-price-pulse 0.48s ease;
}
.sim-price-amount--up.sim-price-amount--flash {
  animation: sim-price-pulse-up 0.48s ease;
}
.sim-price-amount--down.sim-price-amount--flash {
  animation: sim-price-pulse-down 0.48s ease;
}
@keyframes sim-price-pulse {
  0% { transform: scale(1); color: var(--accent); }
  35% { transform: scale(1.06); color: var(--primary); }
  100% { transform: scale(1); color: var(--accent); }
}
@keyframes sim-price-pulse-up {
  0%   { transform: scale(1);    color: var(--accent); }
  30%  { transform: scale(1.08); color: #e02b2b; text-shadow: 0 0 8px rgba(244,12,54,0.35); }
  100% { transform: scale(1);    color: var(--accent); text-shadow: none; }
}
@keyframes sim-price-pulse-down {
  0%   { transform: scale(1);    color: var(--accent); }
  30%  { transform: scale(1.08); color: var(--success); text-shadow: 0 0 8px rgba(31,138,91,0.4); }
  100% { transform: scale(1);    color: var(--accent); text-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sim-price-amount--flash,
  .sim-price-amount--up.sim-price-amount--flash,
  .sim-price-amount--down.sim-price-amount--flash {
    animation: none;
  }
}

/* ============================================
   スマートサマリーチップ (選択済み項目の横スクロール表示)
   ============================================ */
.fe-summary-chips {
  display: flex;
  gap: 6px;
  padding: 4px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  animation: fe-summary-fade 0.25s ease;
}
.fe-summary-chips::-webkit-scrollbar { display: none; }
@keyframes fe-summary-fade {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fe-summary-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px 5px 9px;
  height: 28px;
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-2);
  white-space: nowrap;
  scroll-snap-align: start;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.15s ease;
  animation: fe-summary-chip-in 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.fe-summary-chip:hover { background: var(--primary-100); }
.fe-summary-chip:active { transform: scale(0.95); }
.fe-summary-chip__icon { font-size: 12px; line-height: 1; }
.fe-summary-chip__label {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes fe-summary-chip-in {
  0%   { opacity: 0; transform: translateY(4px) scale(0.85); }
  100% { opacity: 1; transform: translateY(0)   scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .fe-summary-chips, .fe-summary-chip { animation: none; }
}

/* ============================================
   レコメンド理由カード (ff_recommend_reasoning)
   ============================================ */
.fe-reason-card {
  margin: 15px 15px 4px;
  padding: 14px 14px 10px;
  background: linear-gradient(135deg, #FFFBED 0%, #FFF4D6 100%);
  border: 1px solid #F4C744;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(244, 165, 33, 0.12);
  animation: fe-reason-in 0.4s ease-out;
}
@keyframes fe-reason-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fe-reason-card__head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: #8B5A00;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.fe-reason-card__sparkle {
  font-size: 16px;
  animation: fe-reason-sparkle 2.4s ease-in-out infinite;
}
@keyframes fe-reason-sparkle {
  0%, 100% { transform: rotate(0)    scale(1); }
  25%      { transform: rotate(-12deg) scale(1.18); }
  50%      { transform: rotate(8deg)  scale(0.92); }
  75%      { transform: rotate(-5deg) scale(1.06); }
}
.fe-reason-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fe-reason-card__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding:10px;
  background: #fff;
  border-radius: 10px;
  animation: fe-reason-item-in 0.34s cubic-bezier(0.34, 1.4, 0.64, 1) backwards;
}
@keyframes fe-reason-item-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.fe-reason-card__icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.05));
}
.fe-reason-card__body { flex: 1; min-width: 0; }
.fe-reason-card__title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-0);
  line-height: 1.35;
}
.fe-reason-card__sub {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 3px;
  line-height: 1.45;
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .fe-reason-card, .fe-reason-card__item, .fe-reason-card__sparkle { animation: none; }
}

/* ============================================
   Exit-intent モーダル (ff_exit_intent)
   ============================================ */
.fe-exit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 13, 0.6);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fe-exit-overlay-in 0.22s ease-out;
}
@keyframes fe-exit-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.fe-exit-modal {
  position: relative;
  max-width: 360px;
  width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: fe-exit-modal-in 0.32s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes fe-exit-modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.fe-exit-modal__close {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ink-7);
  color: var(--ink-2);
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: none;
}
.fe-exit-modal__icon {
  font-size: 40px;
  text-align: center;
  margin-bottom: 8px;
  animation: fe-exit-icon-bob 1.6s ease-in-out infinite;
}
@keyframes fe-exit-icon-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
.fe-exit-modal__title {
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink-0);
  line-height: 1.4;
  margin-bottom: 8px;
}
.fe-exit-modal__sub {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 16px;
}
.fe-exit-modal__sub strong { color: var(--accent); }
.fe-exit-modal__cta {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--primary-2);
  transition: transform 0.1s ease;
}
.fe-exit-modal__cta:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--primary-2); }
.fe-exit-modal__note {
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .fe-exit-overlay, .fe-exit-modal, .fe-exit-modal__icon { animation: none; }
}

/* ============================================
   信頼バッジ (ff_trust_badge)
   ============================================ */
/* ヘッダー直下: 3カラムストリップ */
.fe-trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 6px 0 12px;
  animation: fe-trust-strip-in 0.36s ease-out;
}
@keyframes fe-trust-strip-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fe-trust-strip__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 9px 9px;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  border-radius: 12px;
  border: 1px solid rgba(0,104,183,0.10);
  box-shadow: 0 3px 9px -5px rgba(0,77,136,0.22), inset 0 1px 0 #fff;
  min-width: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.fe-trust-strip__item:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px -2px rgba(0,77,136,0.18);
}
.fe-trust-strip__icon {
  display: grid;
  place-items: center;
  width: 27px; height: 27px;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--primary-50);
  color: var(--primary);
}
.fe-trust-strip__item.fe-trust--accent  .fe-trust-strip__icon { background: var(--accent-50);  color: var(--accent); }
.fe-trust-strip__item.fe-trust--success .fe-trust-strip__icon { background: var(--success-50); color: #157a4f; }
.fe-trust-strip__body { min-width: 0; width: 100%; }
.fe-trust-strip__label {
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fe-trust-strip__value {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink-0);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fe-trust-strip__item.fe-trust--accent  .fe-trust-strip__value { color: var(--accent); }
.fe-trust-strip__item.fe-trust--success .fe-trust-strip__value { color: #157a4f; }
.fe-trust--accent .fe-trust-strip__value { color: var(--accent); }
.fe-trust--success .fe-trust-strip__value { color: var(--success); }

/* 結果シート用: グリッド版 */
.fe-trust-card {
  margin: 15px;
  padding: 16px 14px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #F2F7FF 0%, #DCEAFC 100%);
  border: 1px solid rgba(0, 104, 183, 0.18);
}
.fe-trust-card__title {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-2);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  position: relative;
}
.fe-trust-card__title::before,
.fe-trust-card__title::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1.5px;
  background: var(--primary);
  vertical-align: middle;
  margin: 0 8px;
  opacity: 0.5;
}
.fe-trust-card__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}
.fe-trust-card__item {
  background: #fff;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.fe-trust-card__item:hover {
  border-color: var(--primary-100);
  transform: translateY(-1px);
}
.fe-trust-card__icon { font-size: 24px; line-height: 1; }
.fe-trust-card__value {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-en);
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.fe-trust-card__item.fe-trust--accent  .fe-trust-card__value { color: var(--accent); }
.fe-trust-card__item.fe-trust--success .fe-trust-card__value { color: var(--success); }
.fe-trust-card__label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
  margin-top: 2px;
  letter-spacing: 0.04em;
}
@media (prefers-reduced-motion: reduce) {
  .fe-trust-strip { animation: none; }
  .fe-trust-card__item { transition: none; }
}

/* ============================================
   FeResumeBanner — 「前回の続きから再開」バナー (ff_autosave)
   ============================================ */
.fe-resume {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, #FFF7E0 0%, #FFE7AC 100%);
  border: 1px solid #F2C14E;
  box-shadow: 0 6px 16px -8px rgba(214, 158, 26, 0.5), inset 0 1px 0 rgba(255,255,255,0.65);
  animation: fe-resume-in 0.32s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes fe-resume-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fe-resume__icon {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  font-size: 19px;
  flex-shrink: 0;
  line-height: 1;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 2px 6px -2px rgba(214,158,26,0.55);
}
.fe-resume__body { flex: 1; min-width: 0; }
.fe-resume__title {
  font-size: 13px;
  font-weight: 800;
  color: #6B4E00;
  line-height: 1.3;
}
.fe-resume__sub {
  font-size: 10.5px;
  color: #8A6A1A;
  margin-top: 2px;
  line-height: 1.4;
}
.fe-resume__dropped {
  display: block;
  font-size: 10px;
  color: #9a7c2c;
  margin-top: 2px;
  font-weight: 600;
}
.fe-resume__actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.fe-resume__btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.fe-resume__btn--primary {
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 2px 0 var(--primary-2), 0 5px 12px -5px rgba(0,104,183,0.55);
}
.fe-resume__btn--primary:active { transform: translateY(2px); box-shadow: 0 0 0 var(--primary-2), 0 2px 6px -4px rgba(0,104,183,0.5); }
.fe-resume__btn--ghost {
  background: rgba(255,255,255,0.7);
  color: #7a5e10;
  border: 1px solid rgba(122,94,16,0.32);
}
.fe-resume__btn--ghost:hover { background: #fff; }
.fe-resume__btn--ghost:active { background: #fff; transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
  .fe-resume { animation: none; }
}

/* ============================================
   FeHeroBanner — 流れるグラデ + ライブカウンター
   ============================================ */
.fe-hero {
  position: relative;
  border-radius: 16px;
  padding: 6px 15px;
  margin-bottom: 10px;
  display: flex;
  gap: 13px;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #0860AA 0%, #0A6FB8 48%, #1379C4 100%);
  background-size: 180% 180%;
  animation: fe-hero-gradient 8s ease-in-out infinite;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 12px 26px -12px rgba(0, 64, 116, 0.6),
    0 2px 6px rgba(0, 64, 116, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
/* 立体感: 左上の光 + 右下の陰で平面的なグラデに奥行きを与える */
.fe-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 6% -12%, rgba(255,255,255,0.30), rgba(255,255,255,0) 55%),
    radial-gradient(95% 85% at 112% 122%, rgba(0,40,78,0.5), rgba(0,40,78,0) 60%);
}
@keyframes fe-hero-gradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.fe-hero__shimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0)    30%,
    rgba(255, 255, 255, 0.32) 50%,
    rgba(255, 255, 255, 0)    70%
  );
  transform: translateX(-100%);
  animation: fe-hero-shimmer 5.5s ease-in-out 1.2s infinite;
}
@keyframes fe-hero-shimmer {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}
.fe-hero__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  flex-shrink: 0;
  font-size: 24px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 5px 12px -5px rgba(0,0,0,0.35);
  animation: fe-hero-icon-bob 2.6s ease-in-out infinite;
}
@keyframes fe-hero-icon-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-2px) rotate(2deg); }
}
.fe-hero__body { position: relative; flex: 1; min-width: 0; }
.fe-hero__title {
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 7px;
  text-shadow: 0 1px 2px rgba(0, 40, 78, 0.35);
}
.fe-hero__time {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 800;
  color: #5A3A00;
  background: linear-gradient(135deg, #FFDD75 0%, #FFB422 100%);
  padding: 2px 9px;
  border-radius: 99px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px -1px rgba(255, 176, 32, 0.6), inset 0 1px 0 rgba(255,255,255,0.55);
}
.fe-hero__sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 3px;
  font-weight: 600;
}
.fe-hero__live {
  margin-top: 3px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.94);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  background: rgba(0, 36, 70, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 3px 10px 3px 9px;
  border-radius: 99px;
}
.fe-hero__live strong {
  font-family: var(--font-en);
  color: #FFD24D;
  font-weight: 900;
  font-size: 13.5px;
  margin: 0 1px;
  font-variant-numeric: tabular-nums;
}
.fe-hero__live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3DE08A;
  box-shadow: 0 0 0 0 rgba(61, 224, 138, 0.7);
  animation: fe-hero-dot-pulse 1.6s ease-out infinite;
}
@keyframes fe-hero-dot-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(61, 224, 138, 0.65); }
  70%  { box-shadow: 0 0 0 7px rgba(61, 224, 138, 0); }
  100% { box-shadow: 0 0 0 0   rgba(61, 224, 138, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .fe-hero { animation: none; background: linear-gradient(135deg, #0860AA 0%, #1379C4 100%); }
  .fe-hero__shimmer, .fe-hero__icon, .fe-hero__live-dot { animation: none; }
}

/* ============================================
   SectionHead (旧 inline style から抜き出し + 完了演出)
   ============================================ */
.fe-section-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  margin-bottom: 14px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: 2px solid transparent;
  transition: background 0.2s, border-color 0.2s, padding 0.2s;
  overflow: hidden;
}
.fe-section-head--missing {
  padding: 10px 12px;
  background: var(--accent-bg);
  border-color: var(--accent);
  border-radius: 8px;
}
.fe-section-head__title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink-0);
  flex: 1;
  line-height: 1.3;
}
.fe-section-head__req {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 2px 8px;
  border-radius: 99px;
}
.fe-section-head__badge {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.fe-section-head__badge--done {
  background: var(--primary);
  color: #fff;
}
.fe-section-head__badge--pop {
  animation: fe-badge-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fe-badge-pop {
  0%   { transform: scale(1)   rotate(0); }
  35%  { transform: scale(1.35) rotate(-8deg); }
  60%  { transform: scale(0.92) rotate(4deg); }
  100% { transform: scale(1)   rotate(0); }
}
/* スイープ光 */
.fe-section-head--pop::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -40%;
  width: 35%;
  background: linear-gradient(
    100deg,
    rgba(31, 138, 91, 0) 0%,
    rgba(31, 138, 91, 0.18) 50%,
    rgba(31, 138, 91, 0) 100%
  );
  pointer-events: none;
  animation: fe-section-sweep 0.85s ease-out;
}
@keyframes fe-section-sweep {
  0%   { left: -40%; opacity: 0; }
  20%  { opacity: 1; }
  100% { left: 110%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .fe-section-head__badge--pop { animation: none; }
  .fe-section-head--pop::after { display: none; }
}

/* 項目に移動 — 緑ピルCTA（既存システム風） */
.sim-jump-btn {
  width: 100%;
  min-height: 52px;
  padding: 8px 22px 8px 14px;
  border: none;
  border-radius: 999px;
  background: #22b573;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 3px 0 #16874a, 0 6px 16px rgba(34, 181, 115, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.15s ease;
}
.sim-jump-btn:hover {
  filter: brightness(1.05);
}
.sim-jump-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #16874a, 0 2px 8px rgba(34, 181, 115, 0.2);
}
.sim-jump-btn__icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink-0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.sim-jump-btn__label {
  line-height: 1.2;
}
.sim-jump-btn__meta {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.95;
  margin-left: 2px;
}
.sim-jump-btn--primary {
  background: var(--primary);
  box-shadow: 0 3px 0 var(--primary-2), 0 6px 16px rgba(0, 104, 183, 0.25);
}
.sim-jump-btn--primary:active {
  box-shadow: 0 1px 0 var(--primary-2);
}

/* 申込完了 CTA の脈動アニメ (ff_apply_pulse) */
.sim-jump-btn--pulse {
  position: relative;
  animation: sim-jump-pulse 2.5s ease-out 0.4s infinite;
}
.sim-jump-btn--pulse::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(0, 104, 183, 0.55);
  animation: sim-jump-pulse-ring 2.5s ease-out 0.4s infinite;
}
@keyframes sim-jump-pulse {
  0%, 75%, 100% { transform: translateZ(0) scale(1); }
  10% { transform: translateZ(0) scale(1.025); }
  20% { transform: translateZ(0) scale(0.99); }
  30% { transform: translateZ(0) scale(1.012); }
  40% { transform: translateZ(0) scale(1); }
}
@keyframes sim-jump-pulse-ring {
  0%   { box-shadow: 0 0 0 0   rgba(0, 104, 183, 0.55); opacity: 1; }
  60%  { box-shadow: 0 0 0 14px rgba(0, 104, 183, 0);    opacity: 0; }
  100% { box-shadow: 0 0 0 0   rgba(0, 104, 183, 0);    opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sim-jump-btn--pulse,
  .sim-jump-btn--pulse::after { animation: none; }
}

/* シミュレーション結果オーバーレイ（フッターより前面） */
.fe-result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.5);
  z-index: 120;
  animation: fadeIn 0.2s ease;
}
.fe-result-sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  height: min(92dvh, 820px);
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 121;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.fe-result-sheet__footer {
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0));
  background: #fff;
  border-top: 1px solid var(--ink-7);
  display: flex;
  gap: 10;
  align-items: center;
  flex-shrink: 0;
}
.fe-result-sheet__footer .btn-ghost {
  flex: 0 0 auto;
  min-width: 72px;
}
.fe-result-sheet__footer .sim-jump-btn {
  flex: 1;
  max-width: none;
}

/* 料金詳細モーダル（既存 cost-details） */
.cost-details-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 200;
}
.modal_box.cost-details {
  display: block;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
  width: 800px;
  max-width: calc(100% - 20px);
  max-height: 82vh;
  padding: 30px;
  background: #fff;
  overflow-y: auto;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
}
.modal_box.cost-details .red {
  color: var(--accent);
}
div.cost-details div.total,
div.cost-details div.list {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
div.cost-details div.sub + div.total {
  margin-top: 15px;
}
div.cost-details div.total p {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
div.cost-details div.sub {
  border: 1px solid #ccc;
  padding: clamp(10px, 1.953vw, 15px);
  margin-top: 10px;
  border-radius: 6px;
}
div.cost-details div.list p {
  font-weight: 500;
  margin: 0;
}
div.cost-details div.list + div.list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e0e0e0;
}
div.cost-details span.tax {
  color: #666;
  font-size: 10px;
  font-weight: 400;
}
div.cost-details span.name {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}
.modal_box.cost-details .b-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  width: 100px;
  height: 30px;
  background: #111;
  border: 1px solid #111;
  border-radius: 2px;
  margin: 30px auto 0;
  cursor: pointer;
  transition: 0.2s ease;
}
.modal_box.cost-details .b-btn:hover {
  color: #111;
  background: #fff;
}

@media screen and (max-width: 768px) {
  .modal_box.cost-details {
    padding: 20px 10px;
    width: calc(100% - 20px);
  }
  div.cost-details div.total p {
    font-size: 14px;
  }
}

/* ========== max-width: 1200px ========== */
@media screen and (max-width: 1200px) {
  .frontend-side-info { display: none; }
  .mobile-stage { gap: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .split-2 { grid-template-columns: 1fr; }
  .split-3 { grid-template-columns: 1fr 1fr; }
  .device-grid { grid-template-columns: repeat(3, 1fr); }
  .portal-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .portal-settings-grid { grid-template-columns: 1fr; }
}

/* ========== max-width: 1024px ========== */
@media screen and (max-width: 1024px) {
  .app-topbar {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }
  .view-switch-wrap {
    order: 3;
    flex: 1 1 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .view-switch { margin-left: 0; width: max-content; min-width: 100%; }
  .app-meta { display: none; }
  .app-brand .tagline { display: none; }

  /* プレビュー用ベゼルを外し実画面幅で表示 */
  .mobile-frame.sim-live {
    width: 100%;
    max-width: 640px;
    height: auto;
    min-height: min(100dvh, 900px);
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }
  .mobile-frame.sim-live::before { display: none; }
  .mobile-frame.sim-live .mobile-screen {
    border-radius: 0;
    min-height: min(100dvh, 900px);
  }

  .pc-sim {
    grid-template-columns: 1fr;
    min-height: auto;
    border-radius: 0;
  }
  .pc-sim-main { border-right: none; }
  .pc-sim-aside {
    position: static;
    height: auto;
    max-height: none;
    border-top: 1px solid var(--ink-6);
  }
  .pc-sim-body { grid-template-columns: 1fr; padding: 20px 16px 28px; }
  .pc-sim-hero { padding: 24px 20px; }
  .pc-sim-plan-grid { grid-template-columns: repeat(3, 1fr); }

  .admin-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    position: relative;
  }
  .admin-nav-toggle {
    display: grid;
  }
  .admin-sidebar-close {
    display: grid;
    place-items: center;
  }
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    width: min(280px, 88vw);
    max-width: 100%;
    padding: 16px 12px;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: none;
    overflow: hidden;
  }
  .admin-shell.admin-nav-open .admin-sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.25);
  }
  @media (prefers-reduced-motion: reduce) {
    .admin-sidebar { transition: none; }
    .admin-nav-backdrop { transition: none; }
  }
  .admin-nav-backdrop {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .admin-shell.admin-nav-open .admin-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .admin-main { min-height: 100dvh; }
  .admin-topbar { padding: 0 16px; gap: 10px; }

  .portal-header { padding: 12px 16px; }
  .portal-tabs { padding: 0 16px; }
  .portal-content { padding: 16px; }
  .portal-login-benefits { grid-template-columns: 1fr; max-width: 480px; }
}

/* ========== max-width: 768px ========== */
@media screen and (max-width: 768px) {
  .stage,
  .stage--frontend,
  .stage--reservation,
  .stage--admin { padding: 0; }

  .status-bar { display: none; }
  .single-page .fe-header { padding-top: env(safe-area-inset-top, 0); }

  .fe-scroll { padding: 16px 14px 280px; }
  .fe-q-title { font-size: 18px; }
  .fe-option { padding: 14px 12px; gap: 10px; }
  .fe-actions { padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0)); }

  .rsp-grid-2,
  .rsp-grid-3,
  .rsp-grid-4,
  .rsp-grid-5,
  .rsp-grid-mnp,
  .rsp-grid-birth,
  .portal-settings-cols { grid-template-columns: 1fr; }

  .rsp-grid-device { grid-template-columns: 1fr; padding: 8px 10px; }
  .pc-sim-plan-grid { grid-template-columns: repeat(2, 1fr); }
  .pc-sim-radio-grid--3,
  .pc-sim-radio-grid--4 { grid-template-columns: 1fr 1fr; }

  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .split-3 { grid-template-columns: 1fr; }
  .device-grid { grid-template-columns: repeat(2, 1fr); }
  .field-grid { grid-template-columns: 1fr; }

  .admin-topbar {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }
  .admin-breadcrumb { flex: 1; min-width: 0; }
  .admin-search-wrap { width: 100%; margin-left: 0; order: 4; }
  .admin-search-wrap .admin-search { width: 100%; }
  .admin-content { padding: 16px; }
  .page-head { flex-direction: column; align-items: flex-start; }

  .portal-kpi-grid { grid-template-columns: 1fr 1fr; }
  .portal-header-actions { width: 100%; justify-content: flex-end; }

  .tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .view-switch button,
  .view-switch a { padding: 7px 12px; font-size: 12px; }
}

/* ========== max-width: 480px ========== */
@media screen and (max-width: 480px) {
  .app-brand > div:last-child > div:first-child { font-size: 14px; }
  .view-switch-label { font-size: 11px; }

  .mobile-frame.sim-live,
  .mobile-frame.sim-live .mobile-screen {
    max-width: none;
    min-height: 100dvh;
  }

  .fe-result-price .amount { font-size: 40px; }
  .fe-slider-value { font-size: 44px; }
  .btn { height: 48px; font-size: 14px; }

  .rsp-grid-2,
  .pc-sim-radio-grid--2,
  .pc-sim-radio-grid--3,
  .pc-sim-radio-grid--4 { grid-template-columns: 1fr; }

  .pc-sim-plan-grid { grid-template-columns: 1fr 1fr; }
  .pc-sim-hero h1 { font-size: 22px !important; }

  .kpi-grid,
  .portal-kpi-grid { grid-template-columns: 1fr; }
  .device-grid { grid-template-columns: 1fr; }

  .sim-bottom-bar { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0)); }
  .sim-price-strip { flex-wrap: wrap; }
  .sim-price-strip > button { flex: 1 1 100%; min-height: 44px; }
}

/* ── UploadBox 画像分析プログレスバー ── */
@keyframes af-progress {
  from { width: 0%; }
  to   { width: 100%; }
}
