/* Web (PWA) build additions. */
.content-gate { margin-left: 0; max-width: none; }
.activation-wrap { display: flex; justify-content: center; padding: var(--space-6) 0; }
.activation-card { width: 100%; max-width: 30rem; }
.activation-card h1 { margin: 0; }
.licensed-to { display: block; margin-top: var(--space-1); overflow-wrap: anywhere; }
.data-warning { margin: 0; }
.app-banner {
  position: fixed;
  left: 50%;
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(36rem, calc(100% - 2 * var(--space-4)));
  background: var(--navy);
  color: white;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  z-index: 45;
}
.app-banner p { margin: 0; flex: 1 1 14rem; }
.app-banner .btn-ghost { color: white; }
@media print { .app-banner { display: none !important; } }
/* Mobile fix: the Menu button inherited white text from the navy top bar (invisible on white). */
.topbar .menu-btn { color: var(--ink); background: white; }
.topbar strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Mobile fix: keep the estimate's amount column from breaking mid-number on narrow screens. */
@media screen and (max-width: 640px) {
  .est-table th:last-child, .est-table td:last-child { white-space: nowrap; overflow-wrap: normal; }
  .sheet { padding-left: var(--space-3); padding-right: var(--space-3); }
}

/* Iteration 2 ------------------------------------------------------------ */
/* Page titles and the main region get programmatic focus for screen readers after navigation.
   They are not interactive, so no outline. Buttons, links, and inputs keep their focus ring. */
h1[tabindex="-1"]:focus, #content[tabindex="-1"]:focus { outline: none; }

/* Compact backup bar (one line of text + buttons). */
.backup-reminder { padding: var(--space-2) var(--space-3); gap: var(--space-2); }
.backup-reminder p { flex: 1 1 12rem; }
.backup-reminder .btn { min-height: 36px; padding-top: 4px; padding-bottom: 4px; }
@media (max-width: 640px) {
  .backup-reminder { font-size: 0.875rem; }
}

/* Duplicate-customer suggestion under the name field. */
.dedupe-suggest:empty { display: none; }
.dedupe-suggest { display: flex; flex-direction: column; gap: var(--space-2); }
.dedupe-suggest .hint { margin: 0; }

/* Sticky price / profit / margin bar on the mobile quote form. */
.profit-bar { display: none; }
@media (max-width: 900px) {
  .profit-bar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 24;
    justify-content: space-around;
    gap: var(--space-2);
    background: var(--navy);
    color: white;
    padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
  }
  .profit-bar span { display: flex; flex-direction: column; align-items: center; min-width: 0; }
  .profit-bar small { font-size: 0.6875rem; color: #b7c5d6; text-transform: uppercase; letter-spacing: 0.04em; }
  .profit-bar strong { font-size: 1rem; white-space: nowrap; }
  .profit-bar .good strong { color: #8fe0b4; }
  .profit-bar .bad strong { color: #ffb3a8; }
  .content:has(.profit-bar) { padding-bottom: 96px; }
  #toasts { bottom: 80px; }
}
@media print { .profit-bar, .demo-ribbon { display: none !important; } }

/* Demo mode */
.demo-ribbon {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2);
  background: #fff4cc; border-bottom: 1px solid #ead9b0; color: #3e2c10;
  padding: var(--space-2) var(--space-4);
  margin-left: var(--sidebar);
}
.demo-ribbon p { margin: 0; flex: 1 1 14rem; }
@media (max-width: 900px) { .demo-ribbon { margin-left: 0; } }
.sheet-demo { position: relative; overflow: hidden; }
.demo-watermark {
  position: absolute; inset: 40% 0 auto 0; margin: 0; text-align: center;
  font-size: 4rem; font-weight: 800; color: rgba(20, 32, 51, 0.10);
  transform: rotate(-30deg); pointer-events: none; user-select: none;
}
@media print { .demo-watermark { color: rgba(0, 0, 0, 0.12) !important; print-color-adjust: exact; } }

.install-steps { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: var(--space-1); }
.activation-status p { margin: 0 0 var(--space-1); }
.restore-hint p { margin: 0; }

/* ---------- Iteration 3 ---------- */
.brand-app-icon { border-radius: 7px; display: block; }

/* Device list on the activation-refused screen */
.device-limit-panel { border-top: 1px solid var(--line, #d8dee6); padding-top: var(--space-4); }
.device-limit-panel .h3 { font-size: 1.0625rem; margin: 0; }
.device-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--line, #d8dee6); border-radius: 8px; background: white; }
.device-row strong, .device-row .hint { display: block; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 0.875rem; }
.inline-field { display: flex; gap: var(--space-2); align-items: flex-end; flex-wrap: wrap; }
.inline-field .field { flex: 1 1 220px; margin: 0; }

/* Styled file picker (native input visually hidden but focusable via its label button) */
.file-picker { display: flex; flex-direction: column; gap: var(--space-2); }
.file-picker-label { font-weight: 600; }
.file-picker-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.file-picker-name { color: var(--muted, #5b6b7f); overflow-wrap: anywhere; }
.file-picker.has-file .file-picker-name { color: var(--ink); font-weight: 600; }
.visually-hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.file-picker-btn { cursor: pointer; }
.visually-hidden-file:focus-visible + .file-picker-btn, .file-picker-btn:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

/* Quote list filters: folded on phones */
.filters { grid-template-columns: 1.4fr 3.2fr; }
.filter-more > summary { display: none; }
.filter-fields { display: grid; grid-template-columns: 0.8fr 1fr 0.7fr 0.7fr; gap: var(--space-4); align-items: end; }
@media (max-width: 1100px) { .filters { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .filter-more > summary { display: inline-flex; list-style: none; cursor: pointer; }
  .filter-more > summary::-webkit-details-marker { display: none; }
  .filter-more[open] > summary { margin-bottom: var(--space-3); }
  .filter-fields { grid-template-columns: 1fr 1fr; }
}
.invoice-flag { display: block; font-size: 0.8125rem; color: #9a3412; margin-top: 2px; }
.invoice-flag.is-paid { color: #166534; }

/* Quick quote mode */
.mode-switch { display: inline-flex; border: 1px solid var(--line, #c9d2dd); border-radius: 999px; padding: 3px; background: white; align-self: flex-start; }
.seg-btn { border: 0; background: transparent; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 600; color: var(--ink); min-height: 40px; cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--navy, #142033); color: white; }
.quote-form.is-quick .full-only { display: none !important; }
.quote-form:not(.is-quick) .quick-only { display: none !important; }
.summary-col { position: sticky; top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.summary-col .quote-summary { position: static; }
.save-after-summary { display: none; }
@media (max-width: 900px) {
  .summary-col { position: static; }
  .save-in-form { display: none; }
  .save-after-summary { display: flex; }
}

/* Invoices + license line on documents */
.doc-kind { font-weight: 700; letter-spacing: 0.12em; font-size: 0.8125rem; color: #475569; margin: 0 0 var(--space-2); }
.est-due strong { font-size: 1.25rem; }
.paid-stamp { display: inline-block; border: 3px solid #166534; color: #166534; font-weight: 800; letter-spacing: 0.1em; padding: 4px 14px; border-radius: 6px; font-size: 1.25rem; transform: rotate(-4deg); }
.est-license { font-size: 0.6875rem; color: #6b7280; margin-top: var(--space-4); }
.password-dialog .field { margin: 0; }

/* Global: the hidden attribute always hides (.field { display:flex } used to override it,
   so fields like "Custom price" showed even when not used). */
[hidden] { display: none !important; }
