/* ---------- phone billing (see Shared/BillingPhone.razor) ---------- */
.ph { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--soft); padding-bottom: 8px; font-size: 16px; }
.ph button { font: inherit; }
.ph input { font-size: 16px; }

.ph-top { background: var(--red); color: #fff; display: flex; align-items: center; gap: 10px; padding: 8px 10px; position: sticky; top: 0; z-index: 20; }
.ph-icon { width: 44px; height: 44px; flex: none; border: 0; background: rgba(255,255,255,.15); color: inherit; border-radius: 10px; font-size: 26px; line-height: 1; cursor: pointer; }
.ph-bars, .ph-bars::before, .ph-bars::after { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; content: ''; position: relative; margin: 0 auto; }
.ph-bars::before { position: absolute; top: -6px; left: 0; }
.ph-bars::after { position: absolute; top: 6px; left: 0; }
.ph-head-info { flex: 1; min-width: 0; }
.ph-top .ph-total { font-size: 21px; line-height: 1.1; }
.ph-head-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .95; }
.ph-top .ph-link { color: #fff; text-decoration: underline; padding: 2px 2px; }
.ph-top .ph-save { min-width: 96px; min-height: 44px; font-size: 17px; padding: 0 14px; }
.ph-foot { margin-top: auto; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); text-align: center; color: var(--gray500); border-top: 1px solid var(--gray200); background: #fff; }
.ph-date { font-size: 13px; font-weight: 700; line-height: 1.25; }
.ph-date-sub { font-weight: 400; font-size: 11px; opacity: .92; }
.ph-total { font-size: 22px; font-weight: 700; white-space: nowrap; }

.ph-banner { background: #FDF1DC; color: #8A6116; padding: 8px 12px; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ph-error { background: #FDECEE; color: var(--red); padding: 8px 12px; font-size: 14px; }

.ph-card { background: #fff; margin: 10px; border: 1px solid var(--gray200); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ph-pick { width: 100%; min-height: 54px; text-align: left; background: #fff; border: 1px solid var(--gray200); border-radius: 10px; padding: 6px 12px; display: flex; flex-direction: column; justify-content: center; cursor: pointer; position: relative; }
.ph-pick::after { content: ''; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--gray500); border-bottom: 2px solid var(--gray500); transform: translateY(-70%) rotate(45deg); }
.ph-pick-label, .ph-field label { font-size: 12px; color: var(--gray500); }
.ph-pick-value { font-size: 17px; font-weight: 600; padding-right: 22px; }
.ph-placeholder { color: var(--gray500); font-weight: 400; }
.ph-rate { color: var(--green); font-weight: 600; font-size: 14px; margin-left: 6px; white-space: nowrap; }
.ph-field input { width: 100%; min-height: 48px; }
.ph-field label { display: block; margin-bottom: 3px; }
.ph-narr { color: var(--red); font-weight: 700; margin-left: 6px; }
.ph-mob { color: var(--blue); font-weight: 700; margin-left: 6px; }
.dev-suggest.ph-suggest { position: static; max-width: none; min-width: 0; margin: 6px 0 0; box-shadow: none; max-height: 220px; }
.dev-form { grid-template-columns: 1fr; gap: 2px; }
.dev-form label { margin-top: 6px; }
.ph-link { cursor: pointer; text-decoration: underline dotted; }

.ph-row { display: flex; gap: 10px; align-items: stretch; }
.ph-star { flex: 1; min-width: 0; }
.ph-qty { flex: none; display: flex; align-items: center; border: 1px solid var(--gray200); border-radius: 10px; font-size: 20px; font-weight: 700; }
.ph-qty span { min-width: 34px; text-align: center; }
.ph-step { width: 46px; height: 100%; min-height: 54px; border: 0; background: transparent; font-size: 26px; color: var(--red); cursor: pointer; }

.ph-add { min-height: 52px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font-size: 18px; font-weight: 700; cursor: pointer; }
.ph-add:active { filter: brightness(.92); }
.ph-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--gray500); }
.ph-meta input { min-height: 40px; }
.ph-status { font-size: 13px; color: var(--ink); background: var(--secondary); border-radius: 8px; padding: 6px 10px; }
.ph-link { border: 0; background: none; color: var(--blue); font-weight: 700; padding: 6px 4px; cursor: pointer; }

.ph-lines { padding: 0 10px; display: flex; flex-direction: column; gap: 8px; }
.ph-line { background: #fff; border: 1px solid var(--gray200); border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; justify-content: space-between; }
.ph-line-main { min-width: 0; flex: 1; }
.ph-line-seva { font-weight: 700; }
.ph-sl { color: var(--gray500); font-weight: 600; }
.ph-line-who { font-size: 15px; margin-top: 2px; }
.ph-line-narr { font-size: 14px; color: var(--red); margin-top: 2px; }
.ph-line-calc { font-size: 12px; color: var(--gray500); margin-top: 3px; }
.ph-line-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.ph-line-amount { font-size: 18px; font-weight: 700; color: var(--red); }
.ph-remove { width: 40px; height: 40px; border: 0; border-radius: 10px; background: #FDECEE; color: var(--red); font-size: 24px; line-height: 1; cursor: pointer; }
.ph-empty { text-align: center; color: var(--gray500); padding: 22px 8px; font-size: 14px; }

.ph-save { min-width: 140px; min-height: 52px; border: 0; border-radius: 10px; background: var(--green); color: #fff; font-size: 19px; font-weight: 700; cursor: pointer; }
.ph-save:disabled { background: var(--gray200); color: #777; cursor: default; }

.ph-dim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.ph-menu { position: absolute; top: 0; left: 0; bottom: 0; width: min(86vw, 320px); background: #fff; padding: 12px; display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.ph-menu-item { display: block; width: 100%; min-height: 50px; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--soft); color: var(--ink); font-size: 16px; text-decoration: none; cursor: pointer; }
.ph-menu-item:disabled { color: #999; cursor: default; }
.ph-menu-search { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; }
.ph-menu-search input { flex: 1; min-width: 0; }
.ph-menu-note { font-size: 12px; color: var(--gray500); padding: 8px 4px; }

.ph-sheet { position: fixed; inset: 0; z-index: 50; background: #fff; display: flex; flex-direction: column; }
.ph-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: var(--red); color: #fff; font-size: 18px; font-weight: 700; }
.ph-search { margin: 10px; min-height: 48px; width: calc(100% - 20px); }
.ph-sheet-body { flex: 1; overflow: auto; padding: 0 10px 20px; -webkit-overflow-scrolling: touch; }
.ph-sheet-title { font-size: 12px; font-weight: 700; color: var(--gray500); text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 6px; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ph-chip { border: 1px solid var(--gold); background: #FDF1DC; color: #6b4a10; border-radius: 18px; padding: 8px 12px; font-size: 14px; cursor: pointer; }
.ph-item { width: 100%; min-height: 54px; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; border: 0; border-bottom: 1px solid var(--gray200); background: #fff; padding: 8px 4px; font-size: 17px; cursor: pointer; }
.ph-item.sel { background: var(--secondary); }
.ph-stars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: start; }
.ph-star-cell { min-height: 64px; border: 1px solid var(--gray200); border-radius: 10px; background: #fff; padding: 6px 10px; text-align: left; display: flex; flex-direction: column; justify-content: center; cursor: pointer; }
.ph-star-cell.sel { background: var(--secondary); border-color: var(--blue); }
.ph-star-ml { font-size: 18px; font-weight: 600; }
.ph-star-en { font-size: 12px; color: var(--gray500); }

/* the calendar on a phone: day number and star only - the two date lines don't fit a 50 px cell */
@media (max-width: 720px) {
    .overlay .popup.cal { padding: 6px; width: 100vw; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; border-radius: 0; }
    .popup.cal > .cal-grid:not(.cal-dow) { grid-auto-rows: minmax(58px, 1fr); }
    .cal-cell { padding: 2px; }
    .cal-sub { display: none; }
    .cal-star { font-size: 11px; text-align: center; }
    .cal-day { font-size: 16px; }
    .cal-title { font-size: 18px; }
}

/* the payment and periodical pop-ups, on a phone */
@media (max-width: 720px) {
    .overlay { align-items: flex-end; }
    .overlay .popup { width: 100vw; max-width: 100vw; border-radius: 16px 16px 0 0; max-height: 92vh; }
}

/* ---------- tables become cards on a phone (tables marked class="stack") ---------- */
@media (max-width: 720px) {
    table.grid.stack, table.grid.stack tbody, table.grid.stack tr, table.grid.stack td { display: block; width: 100%; }
    table.grid.stack thead { display: none; }
    table.grid.stack tr { border: 1px solid var(--gray200); border-radius: 10px; margin-bottom: 8px; padding: 6px 10px; background: #fff; }
    table.grid.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; border: 0; text-align: right !important; }
    table.grid.stack td::before { content: attr(data-label); flex: none; color: var(--gray500); font-size: 12px; text-align: left; }
    table.grid.stack td:empty { display: none; }
    .report-head { gap: 6px; }
    .report-head h1 { flex-basis: 100%; }
    .report-head label { display: flex; align-items: center; gap: 4px; }
    .report-head input[type=date] { min-width: 0; }
}
