/* スマホ表示（デザイン「Signtop スマホUI設計」準拠）: sp-billing */
@media (max-width: 768px) {
  /* ---------- 請求確認（月送りは上部バーの右） ---------- */
  .bl-sp-month { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; }
  .bl-sp-month b { font-weight: 600; white-space: nowrap; }
  .bl-sp-month button { width: 32px; height: 32px; border: 0; background: transparent; color: #475569; font-size: 20px; line-height: 1; cursor: pointer; border-radius: 8px; }
  .bl-sp-month button:active { background: var(--sp-track); }
  body:has(.bl-sp-head) .topbar, body:has(.cu-sp-head) .topbar { border-bottom-color: transparent; }

  .bl-sp, .cu-sp { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .bl-sp-head { margin: -16px -16px 0; padding: 4px 16px 12px; background: var(--panel); border-bottom: 1px solid var(--sp-line); display: flex; flex-direction: column; gap: 10px; }
  .bl-sp-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .bl-sp-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px; border-radius: 10px; border: 1px solid; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
  .bl-sp-tile span { font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .bl-sp-tile b { font-size: 20px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
  .bl-sp-tile.unreviewed { background: #FFFBEB; border-color: #FDE68A; color: var(--warn); }
  .bl-sp-tile.unissued { background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; }
  .bl-sp-tile.issued { background: #F0FDF4; border-color: #BBF7D0; color: var(--ok); }
  .bl-sp-tile.excluded { background: #F8FAFC; border-color: var(--sp-line); color: var(--sub); }
  .bl-sp-tile.excluded b { color: #475569; }
  .bl-sp-tile.on { box-shadow: 0 0 0 2px currentColor inset; }
  .bl-sp-filter { display: flex; align-items: center; gap: 8px; }
  .bl-sp-filter select { flex: 1 1 auto; min-width: 0; height: 40px; font-size: 15px; border-radius: 10px; }
  .bl-sp-cond { font-size: 12px; color: var(--primary); white-space: nowrap; }
  .bl-sp-clear { flex: 0 0 auto; height: 40px; padding: 0 6px; border: 0; background: transparent; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; }

  .bl-sp-warn { margin-top: 8px; background: var(--warn-weak); border: 1px solid #FDE68A; border-radius: var(--sp-r); padding: 0 12px; }
  .bl-sp-warn summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-height: 48px; padding: 12px 0; cursor: pointer; color: var(--warn); }
  .bl-sp-warn summary span { font-size: 12px; }
  .bl-sp-warn[open] { padding-bottom: 12px; }

  .bl-sp-ghead { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px 8px; }
  .bl-sp-ghead h3 { font-size: 15px; }
  .bl-sp-ghead a { font-size: 13px; font-weight: 600; color: var(--primary); white-space: nowrap; }
  .bl-sp-cards { display: flex; flex-direction: column; gap: 8px; }
  .bl-sp-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--sp-r); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
  .bl-sp-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--sub); margin-bottom: -8px; }
  .bl-sp-edit { border: 0; background: transparent; color: var(--primary); font: inherit; font-size: 13px; font-weight: 600; padding: 4px 0 4px 8px; cursor: pointer; }
  .bl-sp-title { font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
  .bl-sp-card .segs { background: #E9EEF4; }
  .bl-sp-card .segs > button { font-size: 13px; }
  .bl-sp-card .segs + .segs { margin-top: -4px; }
  .bl-sp-note { margin: 0; font-size: 12px; color: #94A3B8; overflow-wrap: anywhere; }
  .bl-sp-note.ok { color: var(--ok); font-weight: 600; }
  .bl-sp-note.memo { color: var(--sub); margin-top: -6px; }
  .bl-sp-empty { background: var(--panel); border: 1px solid var(--sp-line); border-radius: var(--sp-r); margin-top: 12px; }
  .bl-sp > .hint { margin-top: 8px; }

  /* ---------- 取引先一覧 ---------- */
  .cu-sp-search { width: 100%; height: 44px; border-radius: 10px; }
  .cu-sp-found { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--sub); padding: 0 4px; }
  .cu-sp-found button { border: 0; background: transparent; color: var(--primary); font: inherit; font-weight: 600; padding: 6px 0; cursor: pointer; }
  .cu-sp-row .lg-label { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; }
  .cu-sp-row .lg-meta { font-weight: 400; }

  /* ---------- 取引先詳細 ---------- */
  .cu-sp-head { margin: -16px -16px 8px; padding: 0 16px 18px; background: var(--panel); border-bottom: 1px solid var(--sp-line); display: flex; flex-direction: column; gap: 6px; }
  .cu-sp-sub { margin: 0; font-size: 13px; color: var(--sub); overflow-wrap: anywhere; }
  .cu-sp-sub.small { font-size: 12px; }
  .cu-sp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
  .cu-sp-tiles > div { padding: 10px; border-radius: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 2px; }
  .cu-sp-tiles span { font-size: 11px; color: var(--sub); }
  .cu-sp-tiles b { font-size: 20px; font-weight: 700; line-height: 1.2; }
  .cu-sp-tiles .warn { background: #FFFBEB; }
  .cu-sp-tiles .warn span { color: var(--warn); font-weight: 600; }
  .cu-sp-tiles .warn b { color: var(--warn); }
  .cu-sp .sec-head { margin: 4px 4px 0; }
  .cu-sp .list-group { border-color: var(--line); }
  .cu-sp-prow { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; color: var(--text); text-decoration: none; }
  .cu-sp-prow:hover { text-decoration: none; background: #F8FAFC; }
  .cu-sp-prow .top { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--sub); }
  .cu-sp-prow .st { font-size: 11px; font-weight: 600; white-space: nowrap; }
  .cu-sp-prow .st.info { color: var(--primary); } .cu-sp-prow .st.ok { color: var(--ok); } .cu-sp-prow .st.warn { color: var(--warn); } .cu-sp-prow .st.muted { color: var(--sub); }
  .cu-sp-prow .t { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
  .cu-sp-prow .m { font-size: 12px; color: #475569; }
  .cu-sp-bhead { margin-top: 12px !important; }
  .cu-sp-month { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 14px; }
  .cu-sp-month b { font-weight: 600; }
  .cu-sp-month button { width: 32px; height: 32px; border: 0; background: transparent; color: #94A3B8; font-size: 18px; cursor: pointer; }
  .cu-sp-brow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 12px 14px; border: 0; background: transparent; font: inherit; text-align: left; color: var(--text); cursor: pointer; }
  .cu-sp-brow .t { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
  .cu-sp-tag { flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
  .cu-sp-tag.warn { color: var(--warn); background: #FFFBEB; }
  .cu-sp-tag.info { color: #1D4ED8; background: #EFF6FF; }
  .cu-sp-tag.ok { color: var(--ok); background: #F0FDF4; }
  .cu-sp-tag.neutral { color: #475569; background: var(--neutral-weak); }
  .cu-sp-none { margin: 0; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--sp-r); font-size: 13px; color: var(--sub); }
  .cu-sp-warnhead { margin: 8px 4px 0; font-size: 13px; font-weight: 700; color: var(--warn); }
}
