/* Practice demo only: the demo is the Cases tab and the Photos page. */
.tabbar-btn:not([data-tab="cases"]), #tab-more-btn, #google-signin, #cases-add-section { display: none !important; }
/* The "open the back office site" reminder has nowhere to go in the practice copy. */
.field-millinfo-current, a[href*="millinfo.com" i] { display: none !important; }

:root {
  --pd-bg: #ffffff; --pd-text: #1b1f24; --pd-muted: #5b6573; --pd-line: #e3e7ec; --pd-soft: #f5f7f9; --pd-scrim: rgba(15, 20, 26, 0.55);
  --pd-rule: #2f5fa8; --pd-rule-bg: #e6eefb; --pd-lookup: #6a3fa6; --pd-lookup-bg: #f0e9fa;
  --pd-ai: #0f7a63; --pd-ai-bg: #e2f5ef; --pd-human: #a4560b; --pd-human-bg: #fdf0e1; --pd-accent: #0f7a63;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pd-bg: #161a1f; --pd-text: #e8ecf0; --pd-muted: #9aa5b1; --pd-line: #2a3038; --pd-soft: #1e2329; --pd-scrim: rgba(0, 0, 0, 0.65);
    --pd-rule: #8db4f0; --pd-rule-bg: #1d2a3f; --pd-lookup: #c4a5ef; --pd-lookup-bg: #2a2140;
    --pd-ai: #6fd6b9; --pd-ai-bg: #143129; --pd-human: #f2b36b; --pd-human-bg: #3a2814; --pd-accent: #3fb894;
  }
}

.pd-launch-wrap { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 900; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: calc(100vw - 32px); }
.pd-launch-wrap[hidden] { display: none; }
.pd-launch {
  padding: 10px 16px; border: 0; border-radius: 999px; background: var(--pd-accent); color: #fff;
  font: 600 14px/1.2 system-ui, -apple-system, Segoe UI, sans-serif; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); cursor: pointer;
}
.pd-launch[hidden] { display: none; }

dialog.pd-overlay { position: fixed; inset: 0; z-index: 1000; margin: 0; padding: 0; border: 0; width: 100%; height: 100%; max-width: none; max-height: none; background: var(--pd-scrim); color: inherit; }
dialog.pd-overlay[open] { display: flex; align-items: flex-end; justify-content: center; }
dialog.pd-overlay::backdrop { background: transparent; }
@media (min-width: 720px) { dialog.pd-overlay[open] { align-items: center; } }
.pd-sheet {
  width: 100%; max-width: 680px; max-height: 92vh; overflow-y: auto; box-sizing: border-box;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--pd-bg); color: var(--pd-text);
  border-radius: 16px 16px 0 0; font: 15px/1.45 system-ui, -apple-system, Segoe UI, sans-serif;
}
@media (min-width: 720px) { .pd-sheet { border-radius: 16px; padding: 24px; } }

.pd-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.pd-title { margin: 0; font-size: 19px; line-height: 1.25; }
.pd-sub { margin: 4px 0 0; color: var(--pd-muted); }
.pd-close { flex: none; width: 36px; height: 36px; border: 1px solid var(--pd-line); border-radius: 50%; background: var(--pd-soft); color: var(--pd-text); font-size: 20px; line-height: 1; cursor: pointer; }

.pd-bar { height: 8px; border-radius: 999px; background: var(--pd-soft); overflow: hidden; margin: 4px 0 16px; border: 1px solid var(--pd-line); }
.pd-bar-fill { height: 100%; background: var(--pd-accent); }

.pd-legend { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--pd-soft); margin-bottom: 16px; font-size: 13px; color: var(--pd-muted); }
.pd-legend-item { display: flex; gap: 10px; align-items: center; }
.pd-legend-item .pd-badge { min-width: 72px; text-align: center; }

.pd-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pd-rule { color: var(--pd-rule); background: var(--pd-rule-bg); }
.pd-lookup { color: var(--pd-lookup); background: var(--pd-lookup-bg); }
.pd-ai { color: var(--pd-ai); background: var(--pd-ai-bg); }
.pd-human { color: var(--pd-human); background: var(--pd-human-bg); }

.pd-group { margin-bottom: 16px; }
.pd-group-title { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pd-muted); }
.pd-row { padding: 12px; border: 1px solid var(--pd-line); border-radius: 12px; margin-bottom: 8px; }
.pd-row.pd-open { border-color: var(--pd-human); border-style: dashed; }
.pd-row-top { display: flex; gap: 8px; align-items: baseline; }
.pd-q { font-weight: 600; }
.pd-a { margin: 6px 0 4px; font-size: 16px; }
.pd-a-open { color: var(--pd-human); font-weight: 600; }
.pd-why { font-size: 13px; color: var(--pd-muted); margin-top: 2px; }

.pd-note { padding: 10px 12px; border-radius: 10px; background: var(--pd-human-bg); color: var(--pd-text); font-size: 14px; }
.pd-error { color: var(--pd-human); }
.pd-foot { border-top: 1px solid var(--pd-line); padding-top: 14px; margin-top: 8px; color: var(--pd-muted); font-size: 14px; }
.pd-btn { margin-top: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--pd-line); background: var(--pd-soft); color: var(--pd-text); font: inherit; font-weight: 600; cursor: pointer; }

.pd-working { display: flex; gap: 12px; align-items: center; padding: 24px 0; color: var(--pd-muted); }
.pd-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--pd-line); border-top-color: var(--pd-accent); animation: pd-spin 0.9s linear infinite; }
@keyframes pd-spin { to { transform: rotate(360deg); } }

.pd-case { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 12px; margin-bottom: 8px; border: 1px solid var(--pd-line); border-radius: 12px; background: var(--pd-bg); color: var(--pd-text); font: inherit; cursor: pointer; }
.pd-case:disabled { cursor: default; opacity: 0.75; }
.pd-case-addr { font-weight: 600; }
.pd-case-state { font-size: 13px; color: var(--pd-ai); }
.pd-muted { color: var(--pd-muted); }

.pd-launch-alt { background: var(--pd-bg); color: var(--pd-accent); border: 2px solid var(--pd-accent); }
.pd-guide { margin-bottom: 8px; }
.pd-gp { margin: 0 0 12px; }
.pd-gl { margin: 0 0 12px; padding-left: 22px; }
.pd-gl li { margin-bottom: 8px; }
.pd-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 560px) { .pd-shots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pd-shot { border: 1px solid var(--pd-line); border-radius: 12px; padding: 8px; background: var(--pd-soft); min-width: 0; }
.pd-shot img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--pd-line); }
.pd-shot-name { font-weight: 600; margin-top: 6px; font-size: 14px; }
.pd-shot-say { color: var(--pd-accent); font-weight: 600; font-size: 14px; }
.pd-gnav { display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--pd-line); padding-top: 12px; }
.pd-btn-main { background: var(--pd-accent); color: #fff; border-color: var(--pd-accent); }

@media (max-width: 420px) { .pd-launch { padding: 9px 12px; font-size: 13px; } }
.pd-house-card { margin: 12px 0; padding: 14px; border: 2px solid var(--pd-accent); border-radius: 12px; background: var(--pd-ai-bg); color: var(--pd-text); font: 15px/1.45 system-ui, -apple-system, Segoe UI, sans-serif; }
.pd-house-text { margin: 0 0 4px; font-weight: 600; }
.pd-btn-danger { background: #b42318; color: #fff; border-color: #b42318; }
.pd-row.pd-flag { border-color: #b42318; border-style: solid; }
.pd-a-flag { color: #b42318; font-weight: 600; }
.pd-input { display: block; box-sizing: border-box; width: 100%; margin: 4px 0 12px; padding: 12px; border: 1px solid var(--pd-line); border-radius: 10px; background: var(--pd-bg); color: var(--pd-text); font: inherit; font-size: 18px; }

/* Sunshine's test: the practice copy has no route or account inventory to check, so these only ever showed false
   "could not be checked" and "No signal" warnings. A practice Submit shows one line: "Practice: nothing was sent." */
#field-offline-save, #field-inventory-cases, .field-millennium-done { display: none !important; }

/* The early address check, on the Photos page above Submit, and on the case card. */
.pd-addr { margin: 12px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--pd-line); background: var(--pd-soft); color: var(--pd-text); font: 15px/1.45 system-ui, -apple-system, Segoe UI, sans-serif; }
.pd-addr p { margin: 0; }
.pd-addr-title { font-weight: 700; color: #b42318; margin-bottom: 4px !important; }
.pd-addr-held { border: 2px solid #b42318; background: #fdecea; }
.pd-addr-match, .pd-addr-confirmed { border-color: var(--pd-accent); background: var(--pd-ai-bg); }
.pd-addr-unread { border-color: var(--pd-human); border-style: dashed; background: var(--pd-human-bg); }
.pd-addr-held .pd-btn { background: #b42318; color: #fff; border-color: #b42318; }
.pd-card-flag { display: inline-block; margin: 4px 0 0 8px; padding: 2px 8px; border-radius: 999px; background: #b42318; color: #fff; font-size: 12px; font-weight: 700; }
.pd-case .pd-card-flag { margin-left: 0; align-self: flex-start; }
@media (prefers-color-scheme: dark) {
  .pd-addr-held { background: #3a1512; }
  .pd-addr-title { color: #ff9b8f; }
}
.pd-inline-error { margin: -6px 0 12px; font-weight: 600; }
.pd-link { padding: 0; border: 0; background: none; color: var(--pd-accent); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.pd-house-set { border-width: 1px; }
.pd-reset { display: block; margin: -4px 0 14px 4px; font-size: 13px; font-weight: 600; }
/* Practice shows one line after Submit. The office follow-up lines and the one-photo ZIP recovery button are for real cases only. */
[data-add-original-zip], .field-millennium-done, .field-millinfo-current { display: none !important; }
