/* ================================================
   Dashboard page styles (dashboard.html から外部化)
   ================================================ */
/* ===== Icon container tokens (unified) =====
     形: 角丸正方形のみ (10px radius)
     背景: ghost = rgba(255,255,255,0.05), accent-soft = rgba(233,64,122,0.10)
     サイズ: 40px (md, リスト/カード) / 48px (lg, ヒーロー)
     アイコンボタン: 台座なし、hoverのみ薄背景
  */

  /* ===== Quick Actions Grid ===== */
  .qa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: var(--card-gap);
  }

  .qa-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-card);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: transform 0.15s ease;
    text-decoration: none;
    color: var(--text-main);
    min-height: 140px;
    justify-content: center;
  }

  .qa-card:active {
    transform: scale(0.97);
  }

  .qa-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-sub);
  }

  .qa-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
  }

  .qa-badge {
    display: inline-block;
    /* 「本日残り50回」「0/300枚」「未設定箇所あり」は残量と警告を伝える。
       11.2px では目を凝らす必要があった */
    font-size: 0.75rem;
    font-weight: 600;
    /* 薄塗り面(実効 #302029)の上では --accent は 4.02:1 で 4.5:1 を割る */
    color: var(--accent-on-soft);
    background: rgba(233, 64, 122, 0.1);
    padding: 3px 10px;
    border-radius: 999px;
    margin-top: 0;
  }

  .qa-badge:empty {
    display: none;
  }

  .qa-badge-warn {
    color: #fa8c16;
    background: rgba(250, 140, 22, 0.12);
  }

  /* ライトテーマだと #fa8c16 は白地の淡いオレンジ面に乗って 2.14:1 しかなく、
     「未設定箇所あり」が事実上読めなかった。同じ橙系で暗い側に寄せて 4.99:1 にする
     （近隣のバッジは base.css 側で同様のライト向け上書きを持っている） */
  :root[data-theme="light"] .qa-badge-warn {
    color: #a45200;
  }

  /* ===== Stats Card ===== */
  .stats-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-card);
    padding: 24px;
    margin-bottom: var(--card-gap);
  }

  .stats-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
  }

  .stats-card-header i {
    color: var(--accent);
    font-size: 1.1rem;
  }

  .stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    text-align: center;
  }

  .stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .stats-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -0.02em;
    /* 等幅数字: htmxの週次統計更新で桁が変わっても数字が横にガタつかない */
    font-variant-numeric: tabular-nums;
  }

  .stats-label {
    /* 「投稿数」「アクセス数」など数字の意味を示すラベル。
       数字だけ大きくても、何の数字か読めなければ意味がない */
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
  }

  /* Empty state for zero activity */
  .stats-empty {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
  }
  .stats-empty i {
    opacity: 0.6;
    margin-right: 4px;
  }

  /* ===== Week-over-Week Trend ===== */
  .trend-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(233, 64, 122, 0.1);
    color: var(--accent);
  }

  .trend-badge i {
    font-size: 0.65rem;
  }

  /* ===== Auto Status Cards ===== */
  .auto-status-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: var(--card-gap);
  }

  .auto-status-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-card);
    transition: background 0.2s;
    flex-wrap: wrap;
}

  .auto-status-card.is-on {
    background: rgba(233, 64, 122, 0.06);
  }

  /* カード全体が詳細画面へのリンク。ON/OFF と設定はその画面が持つ。
     以前はここにトグルとボタンを詰めていたが、スマホ幅では文字と操作が
     面積を取り合い、どちらも小さくなっていた（押す対象がカード全体に
     なったので、狙いを外さない）*/
  .auto-status-main {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1 1 100%;
    min-width: 0;
    min-height: 44px;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
  }

  .auto-status-chev {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: transform 0.15s ease;
  }

  .auto-status-main:active .auto-status-chev { transform: translateX(2px); }
  .auto-status-main:hover .auto-status-label { color: var(--accent-text); }

  .auto-status-icon {
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--text-muted);
  }

  .auto-status-card.is-on .auto-status-icon {
    color: var(--accent);
  }

  .auto-status-info {
    flex: 1;
    min-width: 0;
  }

  .auto-status-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    margin: 0;
  }

  .auto-status-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 3px;
  }

  /* 出勤が取れていないことは、他の状態文と同じ濃さで書くと埋もれる。
     投稿できない状態なので色を付ける */
  .auto-status-sub.is-alert { color: var(--accent-on-soft); }

  /* システムが止めたときの復帰導線。
     「開始する」だけでは直らない理由（ログイン情報の誤り・プラン期限・
     店舗数上限）のときに、直す場所へ連れて行くリンクを主役として出す。
     ONに戻すだけで直る post_failed では出さない */
  .auto-status-fix {
    /* カード直下の全幅行。文章の列（アイコンとボタンの間）に入れると
       スマホ幅で nowrap の203pxピルがボタンに重なった（390pxで実測）。
       全幅にすればタップ目標も広い */
    display: flex;
    flex-basis: 100%;
    justify-content: center;
    margin-top: 2px;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--accent-on-soft);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
  }

  @media (hover: hover) {
    .auto-status-fix:hover {
      background: var(--accent-soft-2);
      color: var(--accent-on-soft);
    }
  }

  .auto-status-fix:active {
    transform: scale(0.97);
  }

  .auto-status-fix > i {
    font-size: 0.95em;
  }

  /* 復帰導線が出ているときは「開始する」を控えめにする。
     先に直す場所があるのに、押しても止まるボタンが目立つのはよくない */
  .auto-status-card:has(.auto-status-fix) .auto-status-btn {
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.7;
  }

  /* 停止理由が出ているときは、それが「異常」だと分かる色にする。
     既定を無彩色にしてあるので、色が付いていること自体が知らせになる */
  .auto-status-card:has(.auto-status-fix) .auto-status-sub {
    color: var(--accent-on-soft);
    line-height: 1.5;
  }

  .auto-status-btn {
    flex-shrink: 0;
    padding: 14px 22px;
    border-radius: 999px;
    border: none;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: auto;
    text-align: center;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }

  .auto-status-btn.btn-off {
    background: var(--glass-8);
    color: var(--text-muted);
  }

  .auto-status-btn.btn-off:active {
    background: var(--glass-15);
    transform: scale(0.95);
  }

  .auto-status-btn.btn-on {
    background: rgba(233, 64, 122, 0.12);
    /* 薄ピンク面の上で --accent は 4.37:1 で AA 未達。
       面・枠は --accent、文字は --accent-text の規約に合わせる */
    color: var(--accent-text);
  }

  .auto-status-btn.btn-on:active {
    background: rgba(233, 64, 122, 0.2);
    transform: scale(0.95);
  }

  .auto-status-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
  }

  .auto-status-btn.btn-send {
    background: var(--accent-btn);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: auto;
    white-space: nowrap;
  }

  .auto-status-btn.btn-send:active {
    opacity: 0.8;
    transform: scale(0.95);
  }

  .auto-status-btn.btn-send i {
    font-size: 0.85rem;
  }

  .auto-status-gear {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .auto-status-gear:active {
    background: var(--glass-6);
    transform: scale(0.92);
  }

  /* ===== Mitene Settings Popup ===== */
  .mitene-setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .mitene-setting-item:last-child {
    border-bottom: none;
  }

  .mitene-setting-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .mitene-setting-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
  }

  .mitene-setting-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
  }


  .mitene-send-btn {
    width: 100%;
    padding: 16px;
    /* ラベル付きの主要アクションはピル。.btn-accent のコメントにある
       「旧14px角」の残りで、同じ画面の .auto-status-btn(999px) と形が違っていた */
    border-radius: var(--radius-pill);
    border: none;
    /* 白文字を載せるので --accent(3.83:1) ではなく --accent-btn(4.79:1) */
    background: var(--accent-btn);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    transition: opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .mitene-send-btn:active {
    opacity: 0.8;
    transform: scale(0.98);
  }

  /* ===== Recent Posts ===== */
  .recent-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-card);
    padding: 24px;
    margin-bottom: var(--card-gap);
  }

  .recent-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
  }

  .recent-header i.bi-clock-history {
    color: var(--accent);
    font-size: 1.1rem;
  }

  .recent-header-spacer {
    flex: 1;
  }

  .recent-refresh {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .recent-refresh:active {
    transform: scale(0.9);
  }

  .recent-refresh.spinning i {
    animation: spin 0.6s linear infinite;
    display: inline-block;
  }

  .prep-dots::after {
    content: '.';
    display: inline-block;
    width: 12px;
    text-align: left;
    animation: prep-dots-anim 1.5s infinite;
  }

  @keyframes prep-dots-anim {
    0%   { content: '.'; }
    33%  { content: '..'; }
    66%  { content: '...'; }
    100% { content: '.'; }
  }

  @keyframes spin {
    from {
      transform: rotate(0deg);
    }

    to {
      transform: rotate(360deg);
    }
  }

  .recent-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s;
  }

  .recent-item:active {
    opacity: 0.7;
  }

  .recent-item+.recent-item {
    border-top: 1px solid var(--border-subtle);
  }

  .recent-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--glass-5);
    position: relative;
  }

  .recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .recent-thumb-video-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 1.4rem;
    pointer-events: none;
  }

  .recent-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.3rem;
  }

  .recent-meta {
    flex: 1;
    min-width: 0;
  }

  .recent-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .recent-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 3px;
  }

  .recent-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
  }

  .recent-load-more {
    width: 100%;
    padding: 14px;
    border: 1px dashed var(--border-subtle);
    border-radius: 14px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: border-color 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .recent-load-more:active {
    transform: scale(0.98);
  }

  .recent-end-msg {
    text-align: center;
    padding: 14px;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 8px;
  }

  /* --- Recent Post Detail Popup --- */
  .recent-detail-body {
    padding: 4px 0 0;
  }

  .recent-detail-media {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
    max-height: 360px;
  }

  .recent-detail-media img {
    width: 100%;
    height: auto;
    display: block;
  }

  .recent-detail-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
  }

  .recent-detail-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 14px;
  }

  .recent-detail-text {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
  }

  /* --- Skeleton for recent items --- */
  .recent-skeleton {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
  }

  .recent-skeleton+.recent-skeleton {
    border-top: 1px solid var(--border-subtle);
  }

  .skeleton-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--glass-4) 25%, var(--glass-8) 50%, var(--glass-4) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
  }

  .skeleton-text {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--glass-4) 25%, var(--glass-8) 50%, var(--glass-4) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
  }

  .skeleton-text-long {
    width: 65%;
  }

  .skeleton-text-short {
    width: 35%;
    margin-top: 6px;
  }

  /* ===== Skeleton Loading ===== */
  @keyframes shimmer {
    0% {
      background-position: -200% 0;
    }

    100% {
      background-position: 200% 0;
    }
  }

  .skeleton-stat {
    width: 60px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--glass-4) 25%, var(--glass-8) 50%, var(--glass-4) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
  }

  /* ===== Store Selector Trigger ===== */
  .store-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    background: var(--bg-card);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.15s ease;
    margin-bottom: var(--card-gap);
    /* button化に伴うUA既定スタイルの打ち消し */
    font: inherit;
    text-align: left;
    color: var(--text-main);
    -webkit-tap-highlight-color: transparent;
  }

  .store-trigger:active {
    transform: scale(0.98);
  }

  .store-trigger-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--glass-5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 1.3rem;
  }

  .store-trigger-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .store-trigger-info {
    flex: 1;
    min-width: 0;
  }

  .store-trigger-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .store-trigger-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
  }

  .store-trigger-arrow {
    color: var(--text-muted);
    font-size: 1.15rem;
    flex-shrink: 0;
  }

  /* ===== Store Picker Popup ===== */
  .store-picker-overlay {
    position: fixed;
    inset: 0;
    /* 背面の暗さも他のシートと同じ 0.7 に揃える */
  background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .store-picker-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .store-picker-sheet {
  /* 他のシート(.notif/.pm/.sp-sheet)は max-width で中央に寄せている。
     ここだけ left/right:0 のままで、広い画面では画面幅いっぱいに
     広がって別物に見えていた */
  max-width: var(--max-w);
  margin: 0 auto;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    /* 他のシート(base.css の .notif/.pm/.sp-sheet)と同じ角丸に揃える */
  border-radius: 20px 20px 0 0;
    padding: 0 20px calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 9001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 80vh;
    overflow-y: auto;
  }

  .store-picker-overlay.open .store-picker-sheet {
    transform: translateY(0);
  }

  .store-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 12px;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
  }

      .store-picker-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
  }

  .store-picker-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .store-picker-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    color: var(--text-main);
  }

  .store-picker-item:hover {
    background: var(--glass-4);
  }

  .store-picker-item.active {
    background: rgba(233, 64, 122, 0.08);
    border: 1px solid rgba(233, 64, 122, 0.2);
  }

  .store-picker-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--glass-5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    font-size: 1rem;
    color: var(--text-muted);
  }

  .store-picker-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .store-picker-item.active .store-picker-item-icon {
    border: 2px solid var(--accent);
  }

  .store-picker-item-info {
    flex: 1;
    min-width: 0;
  }

  .store-picker-item-name {
    font-size: 1.02rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 店舗名の横に付ける状態バッジ。
   以前 .store-picker-exceeded-badge というクラス名だけが書かれていて
   CSS 定義が無く、「上限超過」が素のテキストで流れていた（実機で確認）*/
.store-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: middle;
  white-space: nowrap;
}

.store-badge.is-warn {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.store-badge.is-error {
  background: rgba(233, 64, 122, 0.16);
  color: var(--accent-on-soft);
}

[data-theme="dark"] .store-badge.is-warn,
:root:not([data-theme="light"]) .store-badge.is-warn {
  color: #fbbf24;
}

/* 店舗名の下。源氏名の代わりに出るので、ここだけ色を変えて気づかせる */
.store-trigger-warn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 700;
}

.store-picker-item-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
  }

  .store-picker-check {
    color: var(--accent);
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  .store-picker-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 8px 0;
  }

  .store-picker-add {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    /* これはボタンではなく店舗リストの末尾の行。
       同じリストの .store-picker-item と同じ角丸にそろえる */
    border-radius: var(--radius-card);
    cursor: pointer;
    transition: background 0.15s ease;
    border: 1px dashed var(--border-subtle);
    background: transparent;
    width: 100%;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
  }

  .store-picker-add:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(233, 64, 122, 0.04);
  }

  .store-picker-add i {
    font-size: 1.3rem;
  }

  @keyframes skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
  }

/* ===== Empty State (店舗未登録時) ===== */
/* 「中央揃えアイコン+バッジ+見出し+CTA」というテンプレ定型をやめ、
   製品の実物（ZEROPOが書く日記のモック）を見せる編集的な構成。
   ワンサーフェス: ヒーロー/はじめかた/プランを一枚のカードに載せる。
   別カードに分けると表面言語が3つに割れてまとまりが出ない。
   表面1つ・左揃え1つ・塗りCTA1つ・グロー1つ。区切りは罫線だけ */
.es-sheet {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    /* 下が 8px なのは「はじめかた」の節が続く前提（節が自分の下余白を持つ）*/
    padding: 30px 22px 8px;
    margin-bottom: 16px;
  }
  /* 節が無い場合（無料プラン）は、その節が持っていた余白をここで取る */
  .es-sheet--short { padding-bottom: 26px; }
  /* 右上にごく薄いピンクの空気（LPのグロー言語。不透明度は上限0.08）*/
  [data-theme="light"] .es-sheet::before { opacity: 0.6; }
  .es-sheet::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -100px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(233, 64, 122, 0.08), transparent 65%);
    pointer-events: none;
  }
  .es-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--accent-on-soft);
    margin: 0 0 8px;
  }
  .es-title {
    font-size: 1.6rem;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--text-main);
    margin: 0 0 20px;
  }
  .es-title span { color: var(--accent-text); }
  /* 320px級では「ZEROPOにおまか/せ。」と不格好に割れるため一段落とす */
  @media (max-width: 360px) {
    .es-title { font-size: 1.38rem; }
  }

  /* ZEROPOが実際に書く日記のモック。わずかに傾けて「置いてある」奥行きを出す */
  .es-mock {
    position: relative;
    background: var(--glass-4);
    border: 1px solid var(--border-medium);
    border-radius: 14px;
    padding: 13px 15px;
    /* 左に僅かに食い込ませて「机に置いた」非対称を作る */
    margin: 0 6px 20px -4px;
    transform: rotate(-1.6deg);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  }
  [data-theme="light"] .es-mock {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
  }

  .es-mock-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
  }
  .es-mock-name { font-size: 0.84rem; font-weight: 700; color: var(--text-main); }
  .es-mock-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--accent-on-soft);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 3px 9px;
    white-space: nowrap;
  }
  .es-mock-line {
    margin: 0 0 3px;
    font-size: 0.8rem;
    line-height: 1.65;
    color: var(--text-sub);
  }
  .es-mock-line:last-child { margin-bottom: 0; }
  /* 「いま書いている」気配のカーソル */
  .es-mock-caret {
    display: inline-block;
    width: 2px;
    height: 0.95em;
    background: var(--accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: es-caret 1.1s steps(2) infinite;
  }
  @keyframes es-caret { 50% { opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .es-mock-caret { animation: none; } }

  .es-desc {
    font-size: 0.84rem;
    line-height: 1.75;
    color: var(--text-sub);
    margin: 0 0 18px;
  }

  .es-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    border-radius: 999px;
    border: none;
    background: var(--accent-btn);
    color: #fff;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    /* 無料プランでは同じ見た目の <a href="/billing"> として使う */
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18),
                0 6px 18px rgba(233, 64, 122, 0.26);
    /* 押下は即時・復帰はやわらかく（.pe-btn-icon と同じ原則）*/
    transition: filter 0.15s, box-shadow 0.2s,
                transform 0.22s cubic-bezier(.2, .8, .4, 1);
  }

  @media (hover: hover) {
    .es-add-btn:hover {
      filter: brightness(1.05);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
                  0 10px 26px rgba(233, 64, 122, 0.34);
    }
  }

  .es-add-btn:active {
    transform: scale(0.98);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
    transition-duration: .05s;
  }

  /* CTA下の補足行: 所要時間とガイドを1行に畳む（バッジとリンクの2要素を統合）*/
  .es-meta {
    margin: 12px 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
  }
  .es-meta a {
    color: var(--accent-on-soft);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  /* シート内の区切り罫。左右のパディング(22px)を突き抜けて全幅に伸ばす */
  .es-rule {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 24px -22px 0;
  }

  /* はじめかた: 番号+1行テキスト+右端に補足の縦リスト。
     ヒーローと同じ左基準線に乗せて「同じ紙の続き」として読ませる */
  .es-sec { padding: 20px 0 22px; }
  .es-sec-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin: 0 0 14px;
  }
  .es-step {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 7px 0;
  }
  .es-step-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-on-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    /* baseline 揃えだと円が文字より上に浮くため、視覚中心へ下げる */
    transform: translateY(4px);
  }
  .es-step-text { font-size: 0.85rem; font-weight: 700; color: var(--text-main); }
  .es-step-sub {
    margin-left: auto;
    text-align: right;
    font-size: 0.72rem;
    color: var(--text-muted);
  }
  /* 320px級では1行に収まらず「入れ/る」「保/存」と語中で割れる。
     補足を番号ぶん字下げした2行目に落とし、語の切れ目を守る */
  @media (max-width: 360px) {
    .es-step { flex-wrap: wrap; }
    .es-step-sub {
      flex-basis: 100%;
      margin-left: 34px;
      text-align: left;
      margin-top: 1px;
    }
  }

  /* 無料プランの空状態: 価格を主役の活字にする。
     金額を隠したまま「プランを選ぶ」だけ出すと不信を招くので、
     押す前に見せる。装飾は価格そのものが担う */
  .es-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 6px;
  }
  .es-price-yen { font-size: 1.1rem; font-weight: 800; color: var(--accent-text); }
  .es-price-num {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--text-main);
  }
  .es-price-unit { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
  .es-price-note {
    margin: 0 0 16px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
  }
  .es-benefits {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
  }
  .es-benefits li {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-sub);
    line-height: 1.6;
    padding: 4px 0;
  }
  .es-benefits li::before {
    content: "✓";
    color: var(--accent-text);
    font-weight: 700;
    flex-shrink: 0;
  }
  /* 320px級では 2.5rem の金額と単位が1行に収まらない */
  @media (max-width: 360px) {
    .es-price-num { font-size: 2.1rem; }
  }

/* ===== 上限外の店舗のダッシュボード ===== */
/* 枠の内と外を線で描く。実線＝プランで動く枠、破線＝その外。
   どこで切れたかを線そのものが示すので、説明の文章が短くて済む */
.ol-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 24px 20px 20px;
    margin-bottom: 16px;
  }
  .ol-title {
    margin: 0 0 6px;
    font-size: 1.04rem;
    font-weight: 800;
    color: var(--text-main);
  }
  .ol-sub {
    margin: 0 0 6px;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-muted);
  }
  .ol-frame {
    position: relative;
    border: 1.5px solid var(--accent);
    border-radius: 14px;
    padding: 12px 12px 10px;
    margin: 16px 0 10px;
  }
  .ol-frame.is-out {
    border: 1.5px dashed var(--border-medium);
    margin-bottom: 18px;
  }
  /* 枠の見出しは線に食い込ませる。背景をカード色で塗って線を切る */
  .ol-frame-tag {
    position: absolute;
    top: -9px;
    left: 12px;
    padding: 0 7px;
    background: var(--bg-card);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent-text);
  }
  .ol-frame.is-out .ol-frame-tag { color: var(--text-muted); }
  .ol-store {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 2px;
  }
  .ol-ico {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 9px;
    background: var(--glass-6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--accent);
  }
  .ol-name {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
  }
  .ol-state {
    flex-shrink: 0;
    font-size: 0.68rem;
    color: var(--text-muted);
  }
  .ol-state.is-on { color: var(--accent-text); font-weight: 700; }
  /* 止まっている側は文字も落とす（線だけだと状態が伝わりにくい） */
  .ol-frame.is-out .ol-ico,
  .ol-frame.is-out .ol-name { opacity: 0.55; }
  /* 主CTAの形はアプリで1つに統一（.es-add-btn / .lf-btn / .pe-btn と同じ）*/
  .ol-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    border-radius: 999px;
    border: none;
    background: var(--accent-btn);
    color: #fff;
    font-size: 0.98rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18),
                0 6px 18px rgba(233, 64, 122, 0.26);
    transition: filter 0.15s, box-shadow 0.2s,
                transform 0.22s cubic-bezier(.2, .8, .4, 1);
  }
  @media (hover: hover) {
    .ol-btn:hover {
      filter: brightness(1.05);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
                  0 10px 26px rgba(233, 64, 122, 0.34);
    }
  }
  .ol-btn:active {
    transform: scale(0.98);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
    transition-duration: .05s;
  }
  /* 第2の道は塗らない（塗りは1画面に1つ）。枠線のピルにする */
  .ol-btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 46px;
    margin-top: 10px;
    border-radius: 999px;
    border: 1px solid var(--border-medium);
    background: transparent;
    color: var(--text-sub);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
  }
  .ol-note {
    margin: 12px 0 0;
    font-size: 0.74rem;
    line-height: 1.6;
    color: var(--text-muted);
    text-align: center;
  }

/* ===== プラン期限切れのダッシュボード ===== */
/* 残量リングが満了から0へ減る。Mantine RingProgress と同じ作り
   （stroke-dasharray で円周を切り、dashoffset で埋まり具合を決める。
   startAngle 270° ＝ 上から）。アニメは CSS のみ — MUI が
   CircularProgress を JS ではなくキーフレームでやっているのと同じ理由 */
.pe-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 26px 20px 20px;
    margin-bottom: 16px;
    text-align: center;
  }
  .pe-ring-wrap {
    position: relative;
    width: 132px;
    height: 132px;
    margin: 0 auto 18px;
  }
  /* -90deg で始点を12時に持ってくる（SVGの円は3時から描かれる）*/
  .pe-ring { display: block; transform: rotate(-90deg); }
  .pe-ring-track { fill: none; stroke: var(--glass-6); }
  .pe-ring-bar {
    fill: none;
    stroke: var(--accent);
    stroke-linecap: round;
    /* 円周 2πr = 2 × π × 56 ≒ 351.86 */
    stroke-dasharray: 351.86;
    stroke-dashoffset: 351.86;
    animation: pe-drain 1.6s cubic-bezier(.32, .72, .35, 1) .25s both;
  }
  @keyframes pe-drain {
    from { stroke-dashoffset: 0; }
    to   { stroke-dashoffset: 351.86; }
  }
  .pe-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .pe-ring-num {
    font-size: 2.1rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text-main);
    /* 桁が減っても中心がぶれないよう等幅の数字を使う */
    font-variant-numeric: tabular-nums;
  }
  .pe-ring-unit {
    font-size: 0.66rem;
    color: var(--text-muted);
    margin-top: 5px;
    letter-spacing: 0.06em;
  }
  .pe-title {
    margin: 0 0 6px;
    font-size: 1.04rem;
    font-weight: 800;
    color: var(--text-main);
  }
  .pe-sub {
    margin: 0 0 20px;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-muted);
  }
  .pe-sub b { color: var(--text-sub); font-weight: 600; }
  /* 主CTAの形はアプリで1つに統一（.es-add-btn / .lf-btn と同じピル）*/
  .pe-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    border-radius: 999px;
    border: none;
    background: var(--accent-btn);
    color: #fff;
    font-size: 0.98rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18),
                0 6px 18px rgba(233, 64, 122, 0.26);
    transition: filter 0.15s, box-shadow 0.2s,
                transform 0.22s cubic-bezier(.2, .8, .4, 1);
  }
  @media (hover: hover) {
    .pe-btn:hover {
      filter: brightness(1.05);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
                  0 10px 26px rgba(233, 64, 122, 0.34);
    }
  }
  .pe-btn:active {
    transform: scale(0.98);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
    transition-duration: .05s;
  }
  .pe-note {
    margin: 12px 0 0;
    font-size: 0.74rem;
    line-height: 1.6;
    color: var(--text-muted);
  }
  /* 動きを止める設定では、最終状態（空のリングと 0）を静止画で見せる。
     数字はサーバーが契約日数を描いているので、JS 側も同じ判定で早期に 0 にする */
  @media (prefers-reduced-motion: reduce) {
    .pe-ring-bar { animation: none; stroke-dashoffset: 351.86; }
  }

/* ===== ログイン失敗時のダッシュボード ===== */
/* 姫デコに入れない間、この画面に残るのは店舗切替・更新・削除の3つだけ。
   唯一のカードなので、面をアクセントで淡く染めて「ここが用件」と言い切る
   （警告が3箇所に散っていた頃は、どれも読まれなかった）*/
.lf-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 26px 20px 20px;
    margin-bottom: 16px;
  }
  /* 断線図: ZEROPO ─実線─ ✕ ┄破線┄ 姫デコ。
     ロゴは透過PNGをそのまま置く。台座も枠も敷かず、他社ロゴの色も
     殺さない（切れていることは線の種類と✕だけで言う）*/
  .lf-wire {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
  }
  .lf-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
  }
  /* ロゴ同士の間。詰めすぎると断線が読み取れず、広げすぎると
     2つが別々の要素に見え始める。130px が実測の折り合い */
  .lf-cable {
    flex: 0 1 130px;
    display: flex;
    align-items: center;
  }
  .lf-live {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--accent);
  }
  .lf-dead {
    flex: 1;
    height: 0;
    border-top: 3px dashed var(--border-medium);
  }
  .lf-x {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
  }
  .lf-title {
    margin: 0 0 8px;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-main);
    text-align: center;
  }
  .lf-sub {
    margin: 0 0 20px;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-muted);
    text-align: center;
  }
  .lf-sub b { color: var(--text-sub); font-weight: 600; }
  /* 主CTAの形はアプリで1つに統一する（空状態の .es-add-btn と同じ
     ピル・同じ塗り・同じ影・同じ押下感）*/
  .lf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    border-radius: 999px;
    border: none;
    /* 白抜き文字を乗せる塗りは --accent-btn（AA準拠の統一ルール）*/
    background: var(--accent-btn);
    color: #fff;
    font-size: 0.98rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18),
                0 6px 18px rgba(233, 64, 122, 0.26);
    /* 押下は即時・復帰はやわらかく（.es-add-btn と同じ原則）*/
    transition: filter 0.15s, box-shadow 0.2s,
                transform 0.22s cubic-bezier(.2, .8, .4, 1);
  }
  @media (hover: hover) {
    .lf-btn:hover {
      filter: brightness(1.05);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
                  0 10px 26px rgba(233, 64, 122, 0.34);
    }
  }
  .lf-btn:active {
    transform: scale(0.98);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
    transition-duration: .05s;
  }
  /* CTA の下の安心材料。主張させず、しかし必ず読める大きさで */
  .lf-note {
    margin: 12px 0 0;
    font-size: 0.74rem;
    line-height: 1.6;
    color: var(--text-muted);
    text-align: center;
  }
  /* 320px級ではロゴ間を詰めないと図がカードからはみ出す */
  @media (max-width: 360px) {
    .lf-cable { flex-basis: 92px; }
  }

/* ===== 店舗削除ボタン ===== */
.btn-delete-store {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 400;
    padding: 8px 16px;
    cursor: pointer;
    opacity: 0.6;
    min-height: 44px;
  }
  .btn-delete-store:active {
    opacity: 1;
  }
