/* 設計預覽：營業收入（public/js/views/preview/revenue.js）。只放這頁用的 .pv-rv-*，共用的 .pv-* 在 app.css。 */

/* 頂端分頁：原型是標題旁的底線分頁 */
.pv-rv-top {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 0;
}

.pv-rv-tabs.cat-tabs {
  gap: 4px;
}

.pv-rv-tabs.cat-tabs button {
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 18px;
}

.pv-rv-tabs.cat-tabs button[aria-pressed="true"] {
  background: transparent;
  color: var(--green);
  border-bottom-color: var(--terracotta);
  font-weight: 700;
}

.pv-rv-body > * + * {
  margin-top: 12px;
}

/* 輸入：一欄（右邊的近三個月圖表 Dennis 2026-11-05 拿掉） */
.pv-rv-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.pv-rv-input .pv-panel {
  margin: 0;
}

.pv-rv-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
  gap: 16px;
  align-items: start;
}

.pv-rv-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pv-rv-fields .pv-field {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.pv-rv-fields .pv-label {
  color: var(--text);
}

.pv-rv-fields input,
.pv-rv-fields select {
  width: 100%;
  min-width: 0;
}

.pv-rv-items > .pv-label {
  margin-bottom: 6px;
}

.pv-rv-itembox {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.pv-rv-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid var(--line);
}

.pv-rv-item-head {
  border-top: none;
  background: var(--green-soft);
  color: #4d554a;
  font-size: 0.85rem;
  text-align: center;
}

.pv-rv-item-rows {
  max-height: 340px;
  overflow-y: auto;
}

.pv-rv-item-name {
  text-align: center;
  font-size: 0.95rem;
}

.pv-rv-item-name small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.pv-rv-item input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
}

.pv-rv-item-edit {
  grid-template-columns: minmax(0, 1fr) 40px;
}

.pv-rv-x {
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px 8px;
}

.pv-rv-additem {
  width: 100%;
  border: none;
  border-top: 1px dashed var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--green);
  font-weight: 700;
}

.pv-rv-empty {
  padding: 10px;
  font-size: 0.85rem;
}

.pv-rv-itembox-foot {
  display: flex;
  justify-content: flex-end;
  padding: 8px;
  background: var(--green-soft);
  border-top: 1px solid var(--line);
}

.pv-rv-chip {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--green);
  border-radius: 99px;
  background: #fff;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 700;
}

.pv-rv-chip-on {
  background: var(--green);
  color: #fff;
}

.pv-rv-hint {
  margin: 8px 0 0;
  font-size: 0.85rem;
}

.pv-rv-photo {
  margin-bottom: 12px;
}

.pv-rv-save {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* 圖表 */
.pv-rv-period {
  margin-left: 8px;
  font-size: 0.85rem;
  color: var(--text);
}

.pv-rv-unit {
  margin-top: 10px;
  font-size: 0.8rem;
}

.pv-rv-chart {
  display: block;
  width: 100%;
  height: auto;
}

.pv-rv-grid {
  stroke: var(--line);
  stroke-dasharray: 4 3;
}

.pv-rv-axis {
  stroke: #9a9a90;
}

.pv-rv-tick,
.pv-rv-month {
  font-size: 11px;
  fill: var(--muted);
}

.pv-rv-month {
  fill: var(--text);
  font-size: 12px;
}

.pv-rv-val {
  font-size: 11px;
  font-weight: 700;
  fill: var(--text);
}

.pv-rv-bar-0 {
  fill: #e6a23c;
}

.pv-rv-bar-1 {
  fill: #c0583a;
}

.pv-rv-bar-2 {
  fill: #5b8a96;
}

.pv-rv-note {
  margin: 6px 0 0;
  font-size: 0.8rem;
}

/* 本月明細：輸入狀況格子 */
.pv-rv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.pv-rv-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-radius: 2px;
}

.pv-rv-gridwrap {
  overflow-x: auto;
}

.pv-rv-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
}

.pv-rv-grid th {
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.pv-rv-grid th:first-child {
  width: 64px;
  text-align: left;
}

.pv-rv-grid thead small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
}

.pv-rv-grid th.pv-rv-we {
  color: var(--terracotta-dark);
}

.pv-rv-cell {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
}

.pv-rv-ok {
  background: #cfe3d4;
  color: var(--text);
}

.pv-rv-miss {
  background: #f6d3c8;
  border: 1px solid #d9826a;
  color: #9a3412;
  font-weight: 700;
}

.pv-rv-off {
  background: #ebe6de;
}

/* 公司設定：左邊分類、中間清單、右邊編輯 */
.pv-rv-cfg {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.pv-rv-subnav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pv-rv-subnav button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  white-space: normal;
}

.pv-rv-subnav button[aria-current="page"] {
  border-color: var(--green);
  background: #eef4ef;
  box-shadow: inset 3px 0 0 var(--green);
}

.pv-rv-subnav small,
.pv-rv-pt small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.pv-rv-cfgnote {
  margin: 4px 0 14px;
  font-size: 0.9rem;
}

.pv-rv-points {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.pv-rv-ptlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pv-rv-pt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.pv-rv-pt > span:first-child {
  min-width: 0;
  white-space: normal;
}

.pv-rv-pt[aria-expanded="true"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.pv-rv-pt[aria-expanded="true"] small {
  color: #dfe9e2;
}

.pv-rv-ptlist .pv-add {
  margin-top: 0;
  border-color: var(--text);
}

.pv-rv-empty-editor {
  padding: 30px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.pv-rv-editor {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pv-rv-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pv-rv-editor-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.pv-rv-sublabel {
  margin: 14px 0 6px;
}

.pv-rv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pv-rv-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px 2px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #f6f1e6;
  font-size: 0.85rem;
}

.pv-rv-tag .pv-rv-x {
  min-height: 0;
  font-size: 1rem;
}

.pv-rv-tag-new {
  gap: 6px;
  padding: 2px;
  background: #fff;
}

.pv-rv-tag-new input {
  width: 110px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 99px;
}

.pv-rv-tag-new button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 99px;
}

/* 月營收怎麼算：勾哪幾個金額項目算現金 */
.pv-rv-cashpick {
  gap: 6px;
  padding: 4px 12px;
  white-space: nowrap;
  cursor: pointer;
}

.pv-rv-cashpick input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
}

.pv-rv-day input {
  width: 64px;
}

.pv-rv-cfg .pv-table input {
  min-width: 0;
}

/* 窄螢幕（iPad 直放）：輸入頁圖表掉到下面，設定改成上下排 */
@media (max-width: 1000px) {
  .pv-rv-input,
  .pv-rv-cfg,
  .pv-rv-points {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .pv-rv-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 發票輸入（真的頁面 public/js/views/revenue.js） */
.pv-rv-ivsum {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #e8efe9;
}
.pv-rv-ivtotal {
  font-size: 22px;
}
button.pv-rv-cell.pv-rv-off {
  border: 0;
  cursor: pointer;
}

/* 金額明細（Dennis 2026-11-03）：每個金額項目一列，要填人數的多一格 */
.pv-rv-input .pv-col > div {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pv-rv-pays {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pv-rv-pay {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 8px;
}

.pv-rv-pay-people {
  grid-template-columns: minmax(72px, 1fr) minmax(0, 1.4fr) minmax(0, 0.9fr);
}

.pv-rv-pay-name {
  font-weight: 600;
}

.pv-rv-pay input {
  width: 100%;
  min-width: 0;
}

.pv-rv-pay-in {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.pv-rv-payfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.pv-rv-paysum {
  font-size: 1rem;
}

.pv-rv-paytotal {
  font-size: 1.25rem;
  margin-left: 6px;
}

/* 收帳單輸入（Dennis 2026-11-03）：基本資料一排，金額明細和餐點明細並排，下面照片 */
.pv-rv-basics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
}

.pv-rv-basics input,
.pv-rv-basics select {
  width: 100%;
  min-width: 0;
}

.pv-rv-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 1280px) {
  .pv-rv-basics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .pv-rv-two {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 照片核對 */
.pv-rv-checkhead {
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pv-rv-checkhead-ok {
  background: var(--green-soft);
  color: var(--green);
}

.pv-rv-checkhead-bad {
  background: #fff6d8;
  color: #7a5b00;
}

.pv-rv-checktable {
  width: 100%;
  margin-bottom: 8px;
}

.pv-rv-checktable .num {
  text-align: right;
}

.pv-rv-ckbad td {
  background: #fff6d8;
  font-weight: 700;
}

.pv-rv-checkbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

/* 照片 */
.pv-rv-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.pv-rv-thumb {
  position: relative;
}

.pv-rv-thumb img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.pv-rv-thumb .pv-rv-x {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #fff;
  border-radius: 99px;
}

.pv-rv-addphoto {
  min-width: 140px;
  height: 84px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: var(--bg, #faf6ee);
  color: var(--green);
  font-weight: 700;
}

/* 餐點明細照單據上的品項（v0.50）：品名、數量、刪除 */
.pv-rv-item-photo {
  grid-template-columns: minmax(0, 1fr) 80px 28px;
}

/* 照片自動填入：表單上和照片不一樣的格子 */
.pv-rv-diff input {
  background: #fff6d8;
  border-color: #d9a400;
}

/* 照單據上的品項：照片看不清楚的格子＝紅框，改過就拿掉 */
.pv-rv-unsure input {
  border: 2px solid var(--danger, #b42318);
  background: #fff5f5;
}

/* 照片品名對照表（v0.44） */
.pv-rv-linemap {
  margin-top: 10px;
}

.pv-rv-linemap select {
  min-width: 8em;
  max-width: 100%;
}

.pv-rv-readcheck {
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fff6d8;
  font-size: 0.85rem;
}


/* 照片核對有異常（管理者）：本月明細的「!」、收帳單輸入上面的提醒 */
.pv-rv-warn {
  background: #ffe7a3;
  border: 1px solid #d9a400;
  color: #7a5b00;
  font-weight: 700;
}

button.pv-rv-cell.pv-rv-warn {
  cursor: pointer;
}

.pv-rv-alerts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pv-rv-uploaded {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
}

/* 金額明細的編輯項目 */
.pv-rv-pay-edit {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.pv-rv-pay-edit input {
  width: 100%;
  min-width: 0;
}

.pv-rv-pays + .pv-rv-additem {
  margin-top: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

/* 月表（發票客戶）：一次帶入整個月的餐數 */
.pv-rv-monthwrap {
  overflow-x: auto;
  margin: 8px 0;
}

.pv-rv-monthfill td,
.pv-rv-monthfill th {
  white-space: nowrap;
}

/* 本月明細 › 月結金額（v0.29） */
.pv-rv-month-amt { width: 9em; text-align: right; }
.pv-rv-diff { color: var(--danger, #b42318); font-weight: 600; }
.pv-rv-month-btns { display: inline-flex; gap: 6px; }

/* =============================================================
   手機（<768）收帳單輸入：照 PR #108 PJ 手機版設計稿 07（只當參考，沒 merge）。
   Dennis 2026-11-12：只換手機，電腦、iPad 不變；每個欄位都留著；畫面上的說明文字拿掉（之後放說明書）。
   顏色 token（--brand-*、--neutral-*）在 mobile.css，只有主系統的手機版載入；
   營業收入單獨頁（/revenue/，.shell-solo）也載入這個檔，所以下面全部限定 .shell:not(.shell-solo)，單獨頁不受影響。
   ============================================================= */
@media (max-width: 767px) {
  /* 分頁：設計稿 tab-full-page，字大一級、央廚綠底線 */
  .shell:not(.shell-solo) .pv-rv-top {
    margin: 0 0 16px;
    padding: 0;
    border: none;
    background: none;
  }

  .shell:not(.shell-solo) .pv-rv-tabs.cat-tabs {
    flex-wrap: nowrap;
    gap: 0;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--neutral-300);
  }

  .shell:not(.shell-solo) .pv-rv-tabs.cat-tabs::-webkit-scrollbar {
    display: none;
  }

  .shell:not(.shell-solo) .pv-rv-tabs.cat-tabs button {
    position: relative;
    flex: none;
    min-height: 0;
    margin: 0;
    padding: 10px 8px;
    border: none;
    color: var(--neutral-500);
    font-size: 20px;
    line-height: 30px;
    font-weight: 700;
  }

  .shell:not(.shell-solo) .pv-rv-tabs.cat-tabs button::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -1px;
    height: 4px;
    border-radius: 2px 2px 0 0;
    background: transparent;
  }

  .shell:not(.shell-solo) .pv-rv-tabs.cat-tabs button[aria-pressed="true"] {
    color: var(--neutral-800);
    border: none;
  }

  .shell:not(.shell-solo) .pv-rv-tabs.cat-tabs button[aria-pressed="true"]::after {
    background: var(--brand-450);
  }

  /* 區塊：不用外框卡片，直接一段一段往下排；小標 20px */
  .shell:not(.shell-solo) .pv-rv-input .pv-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .shell:not(.shell-solo) .pv-rv-input .pv-col > div {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .shell:not(.shell-solo) .pv-rv-input .pv-panel {
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .shell:not(.shell-solo) .pv-rv-input .pv-panel > .pv-head {
    margin: 0 0 12px;
    padding: 0;
    border: none;
  }

  .shell:not(.shell-solo) .pv-rv-input .pv-head .card-title {
    font-size: 20px;
    line-height: 30px;
    font-weight: 700;
    color: var(--neutral-800);
  }

  /* 說明文字（「沒有的空著」「每種餐點幾個」「…最多 4 張」）拿掉 */
  .shell:not(.shell-solo) .pv-rv-input .pv-head > .muted {
    display: none;
  }

  /* 第一塊「收帳單」的標題和分頁重複，拿掉 */
  .shell:not(.shell-solo) .pv-rv-input .pv-panel:has(.pv-rv-basics) > .pv-head {
    display: none;
  }

  /* 已經輸入過：設計稿 notification（淡綠底） */
  .shell:not(.shell-solo) .pv-rv-input .banner.pv-rv-photo {
    margin: 0 0 16px;
    padding: 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--brand-50);
    color: var(--neutral-800);
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
  }

  /* 基本資料：日期｜輸入人員 一排，收帳點、備註各一整排 */
  .shell:not(.shell-solo) .pv-rv-basics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 8px;
  }

  .shell:not(.shell-solo) .pv-rv-basics > .pv-field:nth-child(n + 3) {
    grid-column: 1 / -1;
  }

  .shell:not(.shell-solo) .pv-rv-input .pv-field {
    gap: 8px;
  }

  .shell:not(.shell-solo) .pv-rv-input .pv-label {
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    color: var(--neutral-800);
  }

  .shell:not(.shell-solo) .pv-rv-basics input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    text-align: left;
  }

  /* 金額明細、餐點明細：上下排；每一列 名稱在左、輸入框在右（設計稿 180px 寬） */
  .shell:not(.shell-solo) .pv-rv-two {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .shell:not(.shell-solo) .pv-rv-pays {
    gap: 8px;
  }

  .shell:not(.shell-solo) .pv-rv-pay,
  .shell:not(.shell-solo) .pv-rv-pay-people {
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 8px 12px;
  }

  .shell:not(.shell-solo) .pv-rv-pay-people > :nth-child(3) {
    grid-column: 2;
  }

  .shell:not(.shell-solo) .pv-rv-pay-name {
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    color: var(--neutral-800);
  }

  /* 金額框前面的「$」、人數後面的「人」不顯示（設計稿沒有；框的名稱已經說了），讓金額框和餐點框對齊 */
  .shell:not(.shell-solo) .pv-rv-pay-in {
    gap: 0;
    font-size: 0;
  }

  .shell:not(.shell-solo) .pv-rv-pay-in input {
    font-size: 16px;
    color: var(--neutral-800);
  }

  .shell:not(.shell-solo) .pv-rv-pay-edit {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .shell:not(.shell-solo) .pv-rv-payfoot {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--neutral-300);
  }

  .shell:not(.shell-solo) .pv-rv-paytotal {
    font-size: 20px;
  }

  .shell:not(.shell-solo) .pv-rv-itembox {
    border: none;
    border-radius: 0;
    background: none;
    overflow: visible;
  }

  .shell:not(.shell-solo) .pv-rv-item-head {
    display: none;
  }

  .shell:not(.shell-solo) .pv-rv-item-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: none;
    overflow: visible;
  }

  .shell:not(.shell-solo) .pv-rv-item {
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 12px;
    padding: 0;
    border: none;
  }

  .shell:not(.shell-solo) .pv-rv-item-edit {
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 8px;
  }

  .shell:not(.shell-solo) .pv-rv-item-photo {
    grid-template-columns: minmax(0, 1fr) 84px 32px;
    gap: 8px;
  }

  .shell:not(.shell-solo) .pv-rv-item-name {
    text-align: left;
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    color: var(--neutral-800);
  }

  .shell:not(.shell-solo) .pv-rv-item input,
  .shell:not(.shell-solo) .pv-rv-pay input {
    min-height: 48px;
    padding: 12px 16px;
  }

  .shell:not(.shell-solo) .pv-rv-x {
    min-height: 48px;
    min-width: 48px;
    color: var(--neutral-600);
  }

  .shell:not(.shell-solo) .pv-rv-itembox-foot {
    margin-top: 16px;
    padding: 12px 0 0;
    border-top: 1px solid var(--neutral-300);
    background: none;
  }

  .shell:not(.shell-solo) .pv-rv-empty {
    padding: 0;
    color: var(--neutral-600);
  }

  .shell:not(.shell-solo) .pv-rv-additem,
  .shell:not(.shell-solo) .pv-rv-pays + .pv-rv-additem {
    min-height: 48px;
    margin-top: 8px;
    border: 1px dashed var(--neutral-300);
    border-radius: var(--radius-md);
    background: none;
    color: var(--brand-450);
  }

  /* 編輯項目／編輯品項（管理者）：文字按鈕 */
  .shell:not(.shell-solo) .pv-rv-input .pv-rv-chip {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--brand-450);
    border-radius: var(--radius-md);
    background: var(--neutral-0);
    color: var(--brand-450);
    font-size: 14px;
    font-weight: 500;
  }

  .shell:not(.shell-solo) .pv-rv-input .pv-rv-chip-on {
    background: var(--brand-450);
    color: var(--neutral-0);
  }

  /* 照片：設計稿 upload，100×100 方格 */
  .shell:not(.shell-solo) .pv-rv-thumbs {
    gap: 8px;
  }

  .shell:not(.shell-solo) .pv-rv-thumb img {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    border-color: var(--neutral-300);
  }

  .shell:not(.shell-solo) .pv-rv-thumb .pv-rv-x {
    top: 4px;
    right: 4px;
    min-width: 0;
    min-height: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    background: rgba(12, 14, 31, 0.6);
    color: var(--neutral-0);
    font-size: 16px;
  }

  .shell:not(.shell-solo) .pv-rv-addphoto {
    min-width: 100px;
    width: 100px;
    height: 100px;
    padding: 4px;
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    background: var(--neutral-100);
    color: var(--brand-450);
    font-size: 14px;
    font-weight: 500;
    white-space: normal;
  }

  /* 還沒有照片：跟進貨入庫單的「相機掃描」一樣，一整條框線按鈕，照片小標拿掉 */
  .shell:not(.shell-solo) .pv-rv-input .pv-panel:has(.pv-rv-addphoto:only-child) > .pv-head {
    display: none;
  }

  .shell:not(.shell-solo) .pv-rv-thumbs:has(.pv-rv-addphoto:only-child) {
    margin-bottom: 0;
  }

  .shell:not(.shell-solo) .pv-rv-addphoto:only-child {
    width: 100%;
    height: 56px;
    min-height: 56px;
    border: 1px solid var(--brand-450);
    background: var(--neutral-0);
    font-size: 16px;
  }

  .shell:not(.shell-solo) .pv-rv-uploaded {
    border-radius: var(--radius-md);
    background: var(--success-bg);
    color: var(--success-text);
    font-weight: 500;
  }

  /* 照片核對下面那句說明拿掉，按鈕留著 */
  .shell:not(.shell-solo) .pv-rv-check .pv-rv-checkbar > span.muted {
    display: none;
  }

  .shell:not(.shell-solo) .pv-rv-check .pv-rv-checkbar {
    justify-content: flex-end;
  }

  .shell:not(.shell-solo) .pv-rv-checktable {
    font-size: 14px;
  }

  /* 月表（發票客戶）：上面那段說明拿掉（還沒設品項時的提醒照樣顯示）；表格本來就可以左右滑 */
  .shell:not(.shell-solo) .pv-rv-monthhelp {
    display: none;
  }

  .shell:not(.shell-solo) .pv-rv-input .pv-rv-checkbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 儲存：置底一整條（設計稿 bottom-bar），捲到哪都按得到 */
  .shell:not(.shell-solo) .pv-rv-save {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 0 -16px;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    border-top: none;
    background: var(--neutral-0);
    box-shadow: 0 -1px 0 var(--neutral-300);
  }

  .shell:not(.shell-solo) .pv-rv-save button {
    width: 100%;
  }

  .shell:not(.shell-solo) .pv-rv-input .form-error {
    margin: 0;
  }
}

/* ---- 手機版本月明細月曆、月結卡片、客戶設定清單（設計稿 08、23）：電腦版看不到 ---- */
.pv-rv-phone,
.pv-rv-ruletag,
.pv-rv-phonenote,
.pv-rv-phoneback {
  display: none;
}

@media (max-width: 767px) {
  .shell:not(.shell-solo) .pv-rv-desk {
    display: none;
  }

  .shell:not(.shell-solo) .pv-rv-phone {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .shell:not(.shell-solo) .pv-rv-phonemonth h2 {
    margin: 0;
    font-size: 20px;
    line-height: 30px;
    font-weight: 700;
    color: var(--neutral-800);
  }

  .shell:not(.shell-solo) .pv-rv-phonehead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .shell:not(.shell-solo) .pv-rv-phonehead input[type="month"] {
    width: 176px;
    flex: none;
    min-height: 48px;
  }

  /* 客戶分頁：設計稿 tabs（底線） */
  .shell:not(.shell-solo) .pv-rv-caltabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--neutral-300);
  }

  .shell:not(.shell-solo) .pv-rv-caltabs::-webkit-scrollbar {
    display: none;
  }

  .shell:not(.shell-solo) .pv-rv-caltabs button {
    position: relative;
    flex: none;
    min-height: 0;
    margin: 0;
    padding: 6px 12px 10px;
    border: none;
    border-radius: 0;
    background: none;
    color: var(--neutral-500);
    font-size: 16px;
    line-height: 24px;
    white-space: nowrap;
  }

  .shell:not(.shell-solo) .pv-rv-caltabs button[aria-selected="true"] {
    color: var(--neutral-800);
    font-weight: 500;
  }

  .shell:not(.shell-solo) .pv-rv-caltabs button[aria-selected="true"]::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 4px;
    border-radius: 2px 2px 0 0;
    background: var(--brand-450);
  }

  /* 要補・不一致・已輸入（設計稿 tag-status） */
  .shell:not(.shell-solo) .pv-rv-stags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .shell:not(.shell-solo) .pv-rv-stag {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 8px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
  }

  .shell:not(.shell-solo) .pv-rv-stag.is-miss {
    background: var(--error-bg);
    color: var(--error-text);
  }

  .shell:not(.shell-solo) .pv-rv-stag.is-warn {
    background: var(--warning-bg);
    color: var(--warning-text);
  }

  .shell:not(.shell-solo) .pv-rv-stag.is-ok {
    background: var(--success-bg);
    color: var(--success-text);
  }

  /* 月曆：一週一排，格子 52px 高 */
  .shell:not(.shell-solo) .pv-rv-cal {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .shell:not(.shell-solo) .pv-rv-calhead,
  .shell:not(.shell-solo) .pv-rv-calgrid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .shell:not(.shell-solo) .pv-rv-calhead span {
    text-align: center;
    font-size: 12px;
    line-height: 18px;
    color: var(--neutral-500);
  }

  .shell:not(.shell-solo) .pv-rv-calhead span.is-off {
    color: var(--neutral-400);
  }

  .shell:not(.shell-solo) .pv-rv-calcell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 52px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--neutral-0);
    color: var(--neutral-800);
  }

  .shell:not(.shell-solo) .pv-rv-calday {
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
  }

  .shell:not(.shell-solo) .pv-rv-calmark {
    min-height: 16px;
    font-size: 12px;
    line-height: 16px;
  }

  .shell:not(.shell-solo) .pv-rv-calcell.is-ok {
    background: var(--success-bg);
    color: var(--success-text);
  }

  .shell:not(.shell-solo) .pv-rv-calcell.is-miss {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
  }

  .shell:not(.shell-solo) .pv-rv-calcell.is-miss .pv-rv-calmark {
    font-weight: 500;
  }

  .shell:not(.shell-solo) .pv-rv-calcell.is-warn {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-icon);
  }

  .shell:not(.shell-solo) .pv-rv-calcell.is-off {
    background: var(--neutral-100);
    color: var(--neutral-400);
  }

  .shell:not(.shell-solo) .pv-rv-calcell.is-future {
    color: var(--neutral-400);
  }

  .shell:not(.shell-solo) .pv-rv-calcell.is-today .pv-rv-calday {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .shell:not(.shell-solo) .pv-rv-callegend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 12px;
    line-height: 18px;
    color: var(--neutral-600);
  }

  .shell:not(.shell-solo) .pv-rv-callegend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .shell:not(.shell-solo) .pv-rv-callegend i {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid transparent;
    border-radius: 3px;
  }

  .shell:not(.shell-solo) .pv-rv-callegend i.is-ok {
    background: var(--success-bg);
    border-color: var(--success-text);
  }

  .shell:not(.shell-solo) .pv-rv-callegend i.is-miss {
    background: var(--error-bg);
    border-color: var(--error-border);
  }

  .shell:not(.shell-solo) .pv-rv-callegend i.is-warn {
    background: var(--warning-bg);
    border-color: var(--warning-icon);
  }

  .shell:not(.shell-solo) .pv-rv-callegend i.is-off {
    background: var(--neutral-100);
    border-color: var(--neutral-300);
  }

  /* 月結金額：一家一張卡片 */
  .shell:not(.shell-solo) .pv-rv-mcards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
  }

  .shell:not(.shell-solo) .pv-rv-mcard {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
  }

  .shell:not(.shell-solo) .pv-rv-mcardhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 16px;
  }

  .shell:not(.shell-solo) .pv-rv-mcardhead b {
    font-weight: 500;
  }

  .shell:not(.shell-solo) .pv-rv-mcardhead span {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
  }

  .shell:not(.shell-solo) .pv-rv-mcardhead small {
    font-size: 12px;
    color: var(--neutral-600);
  }

  .shell:not(.shell-solo) .pv-rv-mcardin {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .shell:not(.shell-solo) .pv-rv-mcardin input {
    width: 100%;
    min-height: 48px;
  }

  .shell:not(.shell-solo) .pv-rv-mcardrev {
    font-size: 12px;
    color: var(--neutral-600);
  }

  /* 客戶設定（設計稿 23）：沒有外框、沒有「客戶」分類框；一排一家＋標籤，置底「＋ 新增客戶」 */
  .shell:not(.shell-solo) .pv-rv-cfg {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
  }

  .shell:not(.shell-solo) .pv-rv-cfg .pv-rv-subnav,
  .shell:not(.shell-solo) .pv-rv-cfgmain > .card-title,
  .shell:not(.shell-solo) .pv-rv-cfgmain > .pv-rv-cfgnote,
  .shell:not(.shell-solo) .pv-rv-empty-editor {
    display: none;
  }

  .shell:not(.shell-solo) .pv-rv-points {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .shell:not(.shell-solo) .pv-rv-ptlist {
    display: contents;
  }

  .shell:not(.shell-solo) .pv-rv-pt {
    order: 1;
    min-height: 0;
    padding: 16px;
    border: none;
    border-bottom: 1px solid var(--neutral-200);
    border-radius: 0;
    background: none;
    color: var(--neutral-800);
  }

  .shell:not(.shell-solo) .pv-rv-pt b {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
  }

  .shell:not(.shell-solo) .pv-rv-pt small {
    margin-top: 4px;
    font-size: 14px;
    line-height: 20px;
    color: var(--neutral-500);
  }

  .shell:not(.shell-solo) .pv-rv-pt > span:last-child {
    font-size: 20px;
    color: var(--neutral-800);
  }

  .shell:not(.shell-solo) .pv-rv-ruletag {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 8px;
    border-radius: var(--radius-xs);
    background: var(--brand-50);
    color: var(--brand-450);
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    white-space: nowrap;
  }

  .shell:not(.shell-solo) .pv-rv-phonenote {
    display: block;
    order: 2;
    margin: 16px 0 0;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--brand-50);
    color: var(--neutral-800);
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
  }

  .shell:not(.shell-solo) .pv-rv-ptlist .pv-add.pv-rv-addpt {
    order: 3;
    position: sticky;
    bottom: 0;
    z-index: 10;
    width: calc(100% + 32px);
    max-width: none;
    margin: 16px -16px 0;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    border: none;
    border-radius: 0;
    background: var(--neutral-0);
    box-shadow: 0 -1px 0 var(--neutral-300);
    font-size: 0;
  }

  .shell:not(.shell-solo) .pv-rv-ptlist .pv-add.pv-rv-addpt::before {
    content: "＋ 新增客戶";
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: var(--radius-sm);
    background: var(--brand-450);
    color: var(--neutral-0);
    font-size: 16px;
    font-weight: 500;
  }

  /* 點一家：整頁換成編輯 */
  .shell:not(.shell-solo) .pv-rv-points.has-sel .pv-rv-pt,
  .shell:not(.shell-solo) .pv-rv-points.has-sel .pv-rv-phonenote,
  .shell:not(.shell-solo) .pv-rv-points.has-sel .pv-rv-addpt {
    display: none;
  }

  .shell:not(.shell-solo) .pv-rv-editor {
    order: 4;
    padding: 0;
    border: none;
  }

  .shell:not(.shell-solo) .pv-rv-editor-head {
    flex-wrap: wrap;
    margin-bottom: 16px;
  }

  .shell:not(.shell-solo) .pv-rv-phoneback {
    display: block;
    flex-basis: 100%;
    min-height: 0;
    padding: 0 0 8px;
    text-align: left;
    font-size: 14px;
  }

  .shell:not(.shell-solo) .pv-rv-editor-head h3 {
    font-size: 20px;
    line-height: 30px;
  }

  .shell:not(.shell-solo) .pv-rv-editor-head .pv-rv-x {
    display: none;
  }
}
