/* js/signpost/prepare-app.css - the agent's Prepare screens (prepare-app.js).
 * Builds on sign-app.css (same card, button, panel and sheet styles). Adds the
 * party list, the chip rows, and party-coloured boxes on the document. */

.pp-parties { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 12px; }
.pp-party {
  border: 1px solid var(--sp-line); border-left: 5px solid var(--sp-party, #8a94a6);
  border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.pp-party input {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--sp-line); border-radius: 10px;
  background: var(--sp-pad-bg); color: #1a2a44; font: inherit; font-size: 16px;
}
.pp-party input:disabled { opacity: .7; }
.pp-party-head { display: flex; align-items: center; gap: 8px; }
.pp-party-head .sp-muted { margin-left: auto; }
.pp-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--sp-party, #8a94a6); flex: none; }
.pp-danger { color: var(--sp-danger); }
.sp-gap { margin-top: 12px; }

.pp-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--sp-muted); margin: 8px 0 4px; }
.pp-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pp-chips::-webkit-scrollbar { display: none; }
.pp-roles { display: flex; gap: 6px; flex-wrap: wrap; }
.pp-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border: 1.5px solid var(--sp-line); border-radius: 999px; background: var(--sp-card); color: var(--sp-text);
  font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; white-space: nowrap; touch-action: manipulation;
}
.pp-chip[aria-checked="true"] { border-color: var(--sp-primary); background: var(--sp-primary); color: var(--sp-primary-text); }
.pp-party-chip[aria-checked="true"] { border-color: var(--sp-party); background: var(--sp-party); color: #fff; }
.pp-party-chip[aria-checked="true"] .pp-dot { background: #fff; }

/* Boxes on the document, coloured by party. */
.pp-pages .sp-box {
  border: 2px solid var(--sp-party, #b89548); border-style: solid;
  background: color-mix(in srgb, var(--sp-party, #b89548) 14%, transparent);
}
.pp-pages .sp-box.is-current { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sp-party, #b89548) 45%, transparent); border-width: 3px; }
.pp-pages .sp-face {
  font-size: clamp(7px, 2vw, 11px); font-weight: 700; color: var(--sp-party, #1a2a44); align-items: center;
  display: block; line-height: 1.6; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}
/* Notices go to the top on the Place screen, clear of the panel's buttons. */
.sp-app[data-screen="fill"] .sp-toast, .sp-app[data-screen="spots"] .sp-toast { top: calc(env(safe-area-inset-top) + 72px); bottom: auto; }
.pp-pages .sp-overlay { cursor: crosshair; }
.sp-app[data-screen="fill"], .sp-app[data-screen="spots"] { --sp-panel-h: 46vh; }

.pp-problems { padding-left: 0; list-style: none; }
.pp-problems li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--sp-line); }
.pp-problems .sp-link { width: auto; margin: 0; min-width: 56px; }

/* Stage 3 v2: the realtor's own filled-in boxes, dragging, and the two modes. */
.pp-pages .sp-box { touch-action: none; }            /* a press on a box drags it, not the page */
.pp-pages .sp-box.pp-fill {
  border: 1.5px solid rgba(26, 42, 68, .55); background: rgba(212, 175, 106, .10);
}
.pp-pages .sp-box.pp-fill .sp-face {
  /* Left-aligned, sitting on the line: how it prints on the contract. */
  display: flex; align-items: flex-end; justify-content: flex-start; line-height: 1.1; padding: 0 3px 1px;
  color: #1a2a44; font-weight: 600; font-size: clamp(8px, 2.3vw, 13px);
}
.pp-pages .sp-box.pp-fill.pp-empty { border-style: dashed; }
.pp-pages .sp-box.pp-fill.pp-empty .sp-face { color: #8a94a6; font-weight: 500; font-style: italic; }
.pp-pages .sp-box.pp-other-mode { opacity: .35; }
.pp-pages .sp-box.pp-dragging { box-shadow: 0 6px 18px rgba(0, 0, 0, .28); opacity: .9; z-index: 5; transition: none; }
.pp-more summary { min-height: 44px; display: flex; align-items: center; color: var(--sp-muted); cursor: pointer; }
.pp-every { margin: 10px 0 4px; }
/* Pick a client from the realtor's own contacts. */
.pp-pick { margin: 8px 0 4px; }
.pp-linked { color: var(--sp-done); margin: 2px 0 6px; }
.pp-contacts { list-style: none; padding: 0; margin: 10px 0 0; }
.pp-contact {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  min-height: 56px; padding: 10px 12px; margin: 0 0 6px; text-align: left; cursor: pointer;
  border: 1px solid var(--sp-line); border-radius: 12px; background: var(--sp-card); color: var(--sp-text); font: inherit;
}
#pp-find { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--sp-line); border-radius: 10px; font: inherit; font-size: 16px; background: var(--sp-pad-bg); color: #1a2a44; }
/* The Send step. */
.sd-who { list-style: none; padding: 0; margin: 4px 0 12px; }
.sd-who li { padding: 8px 0; border-bottom: 1px solid var(--sp-line); }
.sd-crm { color: var(--sp-done); font-size: .85rem; font-weight: 600; }
.sd-save { margin: 8px 0 12px; }
.sp-app[data-screen="send"] textarea, .sp-app[data-screen="send"] select, .sp-app[data-screen="start"] select, .sp-app[data-screen="start"] input:not([type="file"]) {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--sp-line); border-radius: 10px; font: inherit; font-size: 16px; background: var(--sp-pad-bg); color: #1a2a44;
}
/* The file chooser: the real input hidden, a big tappable label instead. */
.sp-field .st-file-input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; overflow: hidden; }
.sp-field .st-file { display: flex; align-items: center; justify-content: center; margin-bottom: 0; min-height: 52px; }
.sp-field { position: relative; }
.sp-app[data-screen="send"] .sp-mark-preview { display: block; max-height: 90px; max-width: 100%; margin: 8px 0; }
/* The tracking screen. */
.tk-parties { list-style: none; padding: 0; margin: 8px 0 14px; }
.tk-party { padding: 12px 0; border-bottom: 1px solid var(--sp-line); }
.tk-line { margin-top: 4px; font-weight: 600; }
.tk-sub { font-size: .85rem; margin-top: 2px; }
/* A client on an expired link asked for a new one (track-model.js askedLine). */
.tk-asked { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #fff4e0; color: #7a4b00; font-size: .85rem; font-weight: 600; }
.tk-note { white-space: pre-wrap; background: var(--sp-bg); border-radius: 10px; padding: 10px 12px; margin: 6px 0 0; }
.tk-remind { margin-top: 8px; }
#tk-reason { width: 100%; min-height: 80px; padding: 10px 12px; border: 1px solid var(--sp-line); border-radius: 10px; font: inherit; font-size: 16px; }

/* ── Forms & packages (templates-app.js, Stage D1) ───────────────────────── */
.tp-list { list-style: none; padding: 0; margin: 0 0 12px; }
.tp-list li + li { margin-top: 8px; }
.tp-item { display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 100%; min-height: 56px; padding: 12px; text-align: left;
  background: var(--sp-card); color: inherit; border: 1px solid var(--sp-line); border-radius: 12px; font: inherit; cursor: pointer; }
.tp-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tp-item-head strong { overflow-wrap: anywhere; }
.tp-status { flex: none; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--sp-line); }
.tp-status.is-on { background: #27ae60; color: #fff; }
.tp-forms { padding-left: 0; list-style: none; margin: 0 0 8px; }
.tp-forms li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--sp-line); }
.tp-form-name { overflow-wrap: anywhere; }
.tp-form-btns { display: flex; gap: 4px; flex: none; }
.sp-card .tp-mini { width: 44px; min-width: 44px; min-height: 44px; padding: 0; margin: 0; }
.sp-card select#tp-add { margin-bottom: 12px; }
.pp-chip:disabled { opacity: .4; cursor: default; }
.sp-app[data-screen="new-form"] select, .sp-app[data-screen="package"] select {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--sp-line); border-radius: 10px;
  background: var(--sp-pad-bg); color: #1a2a44; font: inherit; font-size: 16px;
}

/* Boxes that fill in by themselves (labelled by the broker; never a term). */
.sp-box.pp-autofill { outline: 2px dashed #27ae60; outline-offset: 1px; }
.pp-filled-tag { color: #1e8449; }
.pp-saveinfo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.pp-saveinfo .sp-secondary { width: auto; margin: 0; }
.sp-field select#pp-fill { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--sp-line); border-radius: 10px; background: var(--sp-pad-bg); color: #1a2a44; font: inherit; font-size: 16px; }
.sp-field select#pp-slot-pick { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--sp-line); border-radius: 10px; background: var(--sp-pad-bg); color: #1a2a44; font: inherit; font-size: 16px; }
.tp-warn { font-size: 13px; margin-top: 4px; }
.pp-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; margin: 6px 0; border: 1px dashed #27ae60; border-radius: 10px; }
.pp-suggest .sp-secondary { width: auto; margin: 0; min-height: 40px; }
.pp-suggest .sp-link { margin: 0; }
.sp-panel .pp-find { margin-top: 6px; }

/* ── Fix pages: turn sideways pages upright, take out pages ─────────────── */
.fp-offer { margin: 14px 0 4px; padding: 12px 14px; border: 1px dashed var(--sp-line); border-radius: 12px; }
.fp-offer p { margin: 0 0 4px; }
.fp-offer .sp-secondary { margin-top: 6px; }
.fp-head { display: flex; align-items: center; gap: 10px; }
.fp-head h1 { margin: 0; }
.fp-grid { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.fp-page { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1.5px solid var(--sp-line); border-radius: 12px; background: var(--sp-card); }
.fp-page.is-turned { border-color: var(--sp-box-edge); }
.fp-page.is-out { opacity: .55; border-style: dashed; }
.fp-page.is-out canvas { filter: grayscale(1); }
.fp-pic { display: flex; align-items: center; justify-content: center; min-height: 200px; background: var(--sp-bg); border-radius: 8px; padding: 6px; }
.fp-pic canvas { display: block; max-width: 100%; height: auto; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); background: #fff; }
.fp-meta { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.fp-state { color: var(--sp-text); font-weight: 600; min-height: 1.2em; }
.fp-boxes { color: var(--sp-danger); font-size: .82rem; }
.fp-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fp-tools .sp-secondary { margin: 0; min-height: 44px; font-size: .88rem; }
.fp-tools .fp-out { grid-column: 1 / -1; }
.fp-line { margin: 4px 0 0; font-weight: 600; }
.fp-warn { margin: 6px 0 0; color: #8a6512; font-weight: 600; }
.fp-warn[hidden] { display: none; }

/* A copy of the draft (Check step): set apart from the send buttons. */
.pp-copy { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--sp-line, #e0e4ea); }

