/* The pages of the client portal (portal/app.js, portal/pages/) – for a client of a workshop, on a phone first:
   one column, large targets, plain words. The look is the workshop's: its colour is the accent
   (--portal-accent / --portal-accent-ink, set by the shell from what the core says of the workshop; none = the
   accent of the portal), light and dark by data-theme on <html>. The 3D viewer has its own sheet (viewer.css) and
   takes the same accent. Nothing is loaded from another server; no style is written into a page (the policy of the
   portal allows only this file and viewer.css).
   Source of truth: docs/portal_pages_reference.md, section 5 */

:root {
  --p-accent: var(--portal-accent, #0b63ce);
  --p-accent-ink: var(--portal-accent-ink, #ffffff);
  --p-text: #1e2228;
  --p-muted: #5d6570;
  --p-line: #d5dae1;
  --p-bg: #f3f5f7;
  --p-surface: #ffffff;
  --p-soft: #eef1f4;
  --p-ok: #1f7a3d;
  --p-ok-soft: #e3f3e8;
  --p-warn: #8a5a00;
  --p-warn-soft: #fbefd3;
  --p-bad: #b3261e;
  --p-bad-soft: #fbe6e4;
  --p-shadow: 0 1px 3px rgba(20, 28, 40, 0.08), 0 6px 18px rgba(20, 28, 40, 0.06);
  --p-radius: 14px;
  --p-font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --p-accent: var(--portal-accent, #4d95ea);
  --p-accent-ink: var(--portal-accent-ink, #0d1116);
  --p-text: #e5e8ec;
  --p-muted: #a0a8b3;
  --p-line: #3a4049;
  --p-bg: #15171a;
  --p-surface: #1d2025;
  --p-soft: #262a31;
  --p-ok: #7fd39a;
  --p-ok-soft: #1c3526;
  --p-warn: #f0c56a;
  --p-warn-soft: #3a2f14;
  --p-bad: #ff9a92;
  --p-bad-soft: #442220;
  --p-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--p-bg);
  color: var(--p-text);
  font-family: var(--p-font);
  font-size: 16px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--p-accent);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--p-accent);
  outline-offset: 2px;
}

.portal {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ----- The head: the workshop, and who is signed in ----- */

.p-head {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--p-line);
  background: var(--p-surface);
}

.p-head-in {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1200px;
  height: 52px;
  margin: 0 auto;
  padding: 0 12px 0 16px;
}

.p-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--p-text);
  text-decoration: none;
}

.p-logo {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  object-fit: contain;
}

.p-brand-name {
  overflow: hidden;
  font-size: 17px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-who {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.p-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--p-accent);
  color: var(--p-accent-ink);
  font-size: 13px;
  font-weight: 700;
}

.p-avatar.is-none {
  border: 1px solid var(--p-line);
  background: var(--p-soft);
  color: var(--p-muted);
}

.p-menu {
  position: absolute;
  top: 50px;
  right: 8px;
  z-index: 30;
  display: grid;
  gap: 12px;
  width: min(300px, calc(100vw - 16px));
  padding: 14px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  background: var(--p-surface);
  box-shadow: var(--p-shadow);
}

.p-menu-who {
  display: grid;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--p-line);
}

.p-menu-who span,
.p-menu-label {
  color: var(--p-muted);
  font-size: 13px;
}

.p-menu-group {
  display: grid;
  gap: 5px;
}

.p-choice {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--p-soft);
}

.p-choice button {
  flex: 1;
  min-height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
}

.p-choice button.is-on {
  background: var(--p-surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  font-weight: 700;
}

.p-menu-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.p-menu-out {
  min-height: 44px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}

/* ----- The page ----- */

.p-main {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px 32px;
}

.p-main.is-narrow {
  max-width: 440px;
}

.p-page {
  display: grid;
  gap: 14px;
}

.p-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
}

.p-subtitle {
  margin: -8px 0 0;
  color: var(--p-muted);
}

.p-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  color: var(--p-muted);
  font-size: 15px;
  text-decoration: none;
}

.p-state {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 48px 16px;
  color: var(--p-muted);
  text-align: center;
}

.p-state p {
  margin: 0;
}

.p-empty,
.p-hint {
  margin: 0;
  color: var(--p-muted);
  font-size: 14.5px;
}

.p-card,
.p-box,
.p-design {
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  background: var(--p-surface);
  box-shadow: var(--p-shadow);
}

/* Buttons: one main one a screen, the rest plain. */
.p-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  background: var(--p-surface);
  color: var(--p-text);
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.p-button.is-main {
  border-color: var(--p-accent);
  background: var(--p-accent);
  color: var(--p-accent-ink);
}

.p-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.p-button.is-file {
  position: relative;
  overflow: hidden;
}

.p-button.is-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.p-link {
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--p-accent);
  font-size: 14.5px;
  text-decoration: underline;
  cursor: pointer;
}

.p-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--p-soft);
  color: var(--p-muted);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.p-chip.is-main,
.p-chip.is-review {
  background: var(--p-accent);
  color: var(--p-accent-ink);
}

.p-chip.is-approved,
.p-chip.is-released,
.p-chip.is-done {
  background: var(--p-ok-soft);
  color: var(--p-ok);
}

.p-chip.is-open,
.p-chip.is-note {
  background: var(--p-warn-soft);
  color: var(--p-warn);
}

.p-chip.is-rejected,
.p-chip.is-declined {
  background: var(--p-bad-soft);
  color: var(--p-bad);
}

/* Forms */
.p-form {
  display: grid;
  gap: 12px;
}

.p-field {
  display: grid;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
}

.p-field input,
.p-field textarea,
.p-version select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  background: var(--p-surface);
  font-size: 16px; /* (under 16 px a phone zooms the page when the field is tapped) */
  font-weight: 400;
}

.p-field textarea {
  min-height: 92px;
  resize: vertical;
}

.p-code {
  font-size: 24px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3em;
  text-align: center;
}

.p-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
}

.p-check input {
  width: 22px;
  height: 22px;
  accent-color: var(--p-accent);
}

.p-error {
  margin: 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--p-bad-soft);
  color: var(--p-bad);
  font-size: 14.5px;
}

.p-notice {
  margin: 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--p-warn-soft);
  color: var(--p-warn);
  font-size: 14px;
}

.p-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
}

/* ----- The sign-in ----- */

.p-sign {
  display: grid;
  gap: 12px;
  margin-top: 4vh;
  padding: 22px 20px 24px;
}

.p-sign-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: contain;
}

.p-sign-name {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.p-sign-intro {
  margin: 0;
  color: var(--p-muted);
  font-size: 15px;
}

.p-sign-title {
  margin: 6px 0 0;
  font-size: 17px;
}

/* ----- The orders ----- */

.p-orders,
.p-rows {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  padding: 14px 12px 14px 16px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  background: var(--p-surface);
  box-shadow: var(--p-shadow);
  color: var(--p-text);
  text-decoration: none;
}

.p-order-main {
  display: grid;
}

.p-order-name {
  font-size: 18px;
  line-height: 1.25;
}

.p-order-number,
.p-fact {
  color: var(--p-muted);
  font-size: 13.5px;
}

.p-order-facts {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1;
  align-items: center;
  gap: 6px 8px;
}

.p-order-go,
.p-row-go {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--p-muted);
  font-size: 26px;
  line-height: 1;
}

/* ----- An order ----- */

.p-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
  margin: 0;
}

.p-facts dt {
  grid-row: 1;
  color: var(--p-muted);
  font-size: 13px;
}

.p-facts dd {
  grid-row: 2;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.p-box {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
}

.p-box.is-main {
  border-color: var(--p-accent);
  border-width: 2px;
}

.p-box-title,
.p-section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.p-section-title {
  font-size: 19px;
}

.p-box-text {
  margin: 0;
}

.p-section {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.p-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  background: var(--p-surface);
  color: var(--p-text);
  text-decoration: none;
}

.p-box .p-row {
  border-color: transparent;
  background: var(--p-soft);
}

.p-row-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.p-row-note {
  color: var(--p-muted);
  font-size: 13.5px;
}

.p-row-action {
  color: var(--p-accent);
  font-size: 14.5px;
  font-weight: 700;
}

.p-row .p-row-go {
  grid-row: auto;
}

.p-design {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}

.p-design-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}

/* The chips of a design (new, its state) hold together; a document says that it is new beside its name. */
.p-chips,
.p-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.p-design-name {
  margin: 0;
  font-size: 18px;
}

.p-design-facts,
.p-design-older {
  margin: 0;
  color: var(--p-muted);
  font-size: 14px;
}

/* ----- Comments (an order, the sheet of the viewer) ----- */

.p-comment-text {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.p-comment-reply {
  padding-left: 10px;
  border-left: 3px solid var(--p-line);
  color: var(--p-muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* ----- A paper of the money: a quote, a contract, a document for payment ----- */

.p-paper-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  color: var(--p-muted);
}

.p-chip.is-superseded {
  background: var(--p-soft);
  color: var(--p-muted);
}

.p-variants {
  display: grid;
  gap: 8px;
}

.p-variant {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  min-height: 52px;
  padding: 10px 14px;
  border: 2px solid var(--p-line);
  border-radius: 12px;
  background: var(--p-surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.p-variant.is-on {
  border-color: var(--p-accent);
}

.p-variant:disabled {
  opacity: 0.55;
  cursor: default;
}

.p-lines {
  display: grid;
  margin: 0;
  padding: 0;
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  background: var(--p-surface);
  list-style: none;
}

.p-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: start;
  padding: 11px 14px;
}

.p-line + .p-line {
  border-top: 1px solid var(--p-line);
}

.p-line.is-out .p-line-text strong,
.p-line.is-out .p-line-price {
  color: var(--p-muted);
}

.p-line-pick {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: start;
  cursor: pointer;
}

.p-line-pick input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--p-accent);
}

.p-line-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.p-line-note {
  color: var(--p-muted);
  font-size: 13.5px;
}

.p-line-price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.p-totals {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  background: var(--p-surface);
}

.p-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.p-total-value {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.p-totals.is-counting .p-total-value {
  color: var(--p-muted);
  font-size: 18px;
}

.p-total-note,
.p-total-more {
  margin: 0;
  color: var(--p-muted);
  font-size: 14px;
}

.p-actions {
  display: grid;
  gap: 10px;
}

.p-sums {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  background: var(--p-surface);
}

.p-sums dt {
  color: var(--p-muted);
}

.p-sums dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.p-sums dd.is-strong {
  font-size: 19px;
  font-weight: 700;
}

.p-pay-rows {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-pay-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--p-soft);
}

.p-pay-text {
  display: grid;
  gap: 1px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.p-button.is-small {
  min-height: 36px;
  padding: 4px 12px;
  font-size: 14px;
}

/* How to pay: the QR code beside what a payment says – one under the other on a phone. */
.p-pay-ways {
  display: grid;
  gap: 12px;
}

.p-qr {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--p-muted);
  font-size: 14px;
  text-align: center;
}

/* (A QR code is black on white whatever the look of the portal – a camera reads it; large enough to scan from
   another screen.) */
.p-qr-code {
  width: min(100%, 264px);
  height: auto;
  border-radius: 10px;
}

@media (min-width: 620px) {
  .p-pay-ways {
    grid-template-columns: 264px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
  }
}

.p-paper-file {
  justify-self: start;
}

/* What changed against the version shared before: a sentence a line; a tap on a line shows its cabinet. */
.p-changes {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--p-line);
}

.p-change-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-change {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.p-change-list .p-change,
.p-changes.is-module .p-change {
  padding: 9px 12px;
  border-left: 3px solid var(--p-warn);
  border-radius: 10px;
  background: var(--p-soft);
}

.p-change-list .p-change.is-removed {
  border-left-color: var(--p-line);
  color: var(--p-muted);
}

.p-change-go {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.p-comments {
  display: grid;
  gap: 10px;
  padding: 12px 14px 16px;
  border-top: 1px solid var(--p-line);
}

.p-comments-title {
  margin: 0;
  font-size: 15px;
}

.p-comment-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-comment {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
}

.p-comment.is-shown {
  border-color: var(--p-accent);
  border-width: 2px;
}

.p-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.p-comment-who {
  flex: 1;
  min-width: 0;
  color: var(--p-muted);
  font-size: 13px;
}

.p-comment-where {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: var(--p-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.p-comment-where.is-gone {
  display: inline-flex;
  align-items: center;
  font-weight: 400;
  cursor: default;
}

.p-reply {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--p-soft);
}

.p-reply.is-workshop {
  border-left: 3px solid var(--p-accent);
}

.p-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.p-photos img {
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  object-fit: cover;
}

.p-photo {
  position: relative;
}

.p-photo-remove {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 0;
  top: -6px;
  right: -6px;
  width: 28px;
  height: 28px;
  border: 2px solid var(--p-surface);
  border-radius: 50%;
  background: var(--p-text);
  color: var(--p-surface);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.p-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.p-draft-actions .p-button {
  min-height: 44px;
  padding: 0 14px;
  font-size: 14.5px;
}

/* ----- A design: the bar, the banner, the viewer ----- */

.portal:has(.p-main.is-full) {
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.portal:has(.p-main.is-full) .p-foot {
  display: none;
}

.p-main.is-full {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  max-width: none;
  min-height: 0;
  padding: 0;
}

.p-design-bar {
  border-bottom: 1px solid var(--p-line);
  background: var(--p-surface);
}

.p-design-bar-in,
.p-design-bar > .p-back {
  display: flex;
  align-items: center;
  gap: 4px 12px;
  min-height: 44px;
  padding: 0 12px 0 14px;
}

.p-design-bar .p-back {
  flex: none;
  max-width: 36%;
}

.p-back-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* (A phone: "Back"; a wide screen: the name of the order.) */
.p-back-text.is-long {
  display: none;
}

.p-design-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-version {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  color: var(--p-muted);
  font-size: 13px;
}

.p-version span {
  display: none;
}

.p-version select {
  width: auto;
  max-width: 132px;
  min-height: 36px;
  padding: 4px 8px;
  border-radius: 9px;
  font-size: 14px;
  text-overflow: ellipsis;
}

.p-version-one {
  flex: none;
  color: var(--p-muted);
  font-size: 13.5px;
}

.p-design-banner:empty {
  display: none;
}

.p-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 8px 12px 8px 14px;
  border-bottom: 1px solid var(--p-line);
  background: var(--p-surface);
  font-size: 14.5px;
}

.p-banner-text {
  display: flex;
  flex: 1 1 220px;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
}

.p-banner-actions {
  display: flex;
  gap: 8px;
}

.p-banner-actions .p-button {
  min-height: 42px;
  padding: 0 14px;
  font-size: 14.5px;
}

/* A phone: the scene needs the height – the banner says it in one line, the sheet of the viewer is lower. */
@media (max-width: 719px) {
  .p-banner {
    gap: 5px 10px;
    padding: 6px 12px 7px 14px;
    font-size: 13.5px;
  }

  .p-banner-text {
    flex-basis: 100%;
  }

  .p-banner-actions {
    flex: 1;
  }

  .p-banner-actions .p-button {
    flex: 1;
    min-height: 40px;
  }

  .p-design-stage .pv-sheet {
    max-height: 36vh;
  }
}

.p-toast {
  flex-basis: 100%;
  margin: 0;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--p-ok-soft);
  color: var(--p-ok);
  font-size: 14px;
  font-weight: 600;
}

.p-design-stage {
  position: relative;
  min-height: 0;
}

/* (A client needs no axes X Y Z on the cube of the views.) */
.portal .view-cube-axes {
  display: none;
}

/* The dialog of an approval */
.p-dialog-back {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  background: rgba(10, 14, 20, 0.5);
}

.p-dialog {
  display: grid;
  gap: 12px;
  width: 100%;
  max-height: 92dvh;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  border-radius: 18px 18px 0 0;
  background: var(--p-surface);
}

.p-dialog p {
  margin: 0;
}

.p-dialog-title {
  margin: 0;
  font-size: 20px;
}

.p-dialog-actions {
  display: grid;
  gap: 8px;
}

/* ----- The foot ----- */

.p-foot {
  border-top: 1px solid var(--p-line);
  color: var(--p-muted);
  font-size: 13px;
}

.p-foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
}

.p-foot-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
}

.p-foot a {
  color: inherit;
}

/* ----- A wide screen ----- */

@media (min-width: 720px) {
  .p-head-in {
    height: 60px;
  }

  .p-menu {
    top: 58px;
  }

  .p-main {
    padding-top: 28px;
  }

  .p-version span {
    display: inline;
  }

  .p-version select {
    max-width: none;
  }

  .p-back-text.is-short {
    display: none;
  }

  .p-back-text.is-long {
    display: inline;
  }

  .p-dialog-back {
    align-items: center;
    justify-items: center;
  }

  .p-dialog {
    max-width: 480px;
    border-radius: 18px;
    padding-bottom: 20px;
  }

  .p-dialog-actions {
    grid-template-columns: 1fr auto;
  }

  .p-facts {
    grid-template-columns: repeat(2, max-content);
    gap: 0 40px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .p-button,
  .p-order,
  .p-row {
    transition: background-color 0.12s, border-color 0.12s, box-shadow 0.12s;
  }
}
