/* Customer portal: the working copy of what customers see, and change
   requests. Every class starts .pt- so nothing clashes. Tokens only. */

.pt-chooser { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pt-chooser__lbl { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.pt-chooser__lbl svg { width: 16px; height: 16px; color: var(--accent-ink); }
.pt-chooser .filters { flex: 1; }
.pt-chooser .filter__n { font-weight: 600; padding: 0 8px; }

.pt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--gap); align-items: start; }
.pt-side { gap: 10px; }
@media (max-width: 1280px) { .pt-layout { grid-template-columns: minmax(0, 1fr); } .pt-side { display: none; } }

/* The portal in a browser frame */
.pt-frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-surface); box-shadow: var(--shadow-2); overflow: hidden; min-width: 0; }
.pt-frame__bar { display: flex; align-items: center; gap: 12px; padding: 9px 14px; background: var(--surface-3); border-bottom: 1px solid var(--line); }
.pt-top { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pt-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: var(--fs-sm); }
.pt-brand__mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-control); background: var(--accent); color: var(--on-accent); font: 800 11px var(--font-head); }
.pt-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.pt-nav a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-control); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.pt-nav a svg { width: 15px; height: 15px; }
.pt-nav a:hover { background: var(--surface-2); color: var(--ink); }
.pt-nav a.on { background: var(--accent-soft); color: var(--accent-ink); }
.pt-who { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--ink-2); }
.pt-page { display: grid; gap: 14px; padding: 18px; background: var(--surface-2); max-height: calc(100vh - 300px); overflow-y: auto; }

.pt-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pt-hello h2 { font-size: var(--fs-xl); margin-top: 2px; }
.pt-hello small { font-size: var(--fs-xs); }
.pt-track { display: grid; gap: 12px; padding: 14px 16px; border-radius: var(--r-control); background: var(--surface); border: 1px solid var(--line); }
.pt-track b { color: var(--ink); font-size: var(--fs-sm); }
.pt-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 0; }
.pt-steps li { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; }
.pt-steps li::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.pt-steps li:first-child::before { display: none; }
.pt-steps li.is-done::before, .pt-steps li.is-now::before { background: var(--accent); }
.pt-steps span { position: relative; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-dot); background: var(--surface-3); color: var(--muted); font: 700 12px var(--font-head); border: 2px solid var(--surface); }
.pt-steps span svg { width: 14px; height: 14px; }
.pt-steps .is-done span { background: var(--accent); color: var(--on-accent); }
.pt-steps .is-now span { background: var(--spark); color: #fff; box-shadow: 0 0 0 3px var(--spark-soft); }
.pt-steps small { font-size: 11px; line-height: 1.25; color: var(--ink-2); }
.pt-steps .is-now small { color: var(--ink); font-weight: 700; }

.pt-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; }
.pt-grid--q { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.pt-grid--3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); }
.pt-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-control); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.pt-card h3 { font-size: var(--fs-card); }
.pt-card .btn { align-self: flex-start; }
.pt-card .btn--lg { align-self: stretch; }
.pt-sub { color: var(--ink); font-size: var(--fs-sm); }
.pt-p { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.5; }
.pt-todo { display: grid; }
.pt-todo__row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pt-todo__row:last-child { border-bottom: 0; }
.pt-todo__row.is-done .row__main b { color: var(--muted); text-decoration: line-through; }
.pt-visit { display: flex; align-items: center; gap: 12px; }
.pt-visit__date { width: 52px; flex: none; display: grid; justify-items: center; padding: 6px 0; border-radius: var(--r-control); background: var(--accent-soft); color: var(--accent-ink); }
.pt-visit__date b { font: 800 var(--fs-xl)/1 var(--font-head); }
.pt-visit__date small { font-size: var(--fs-xs); font-weight: 600; }
.pt-visit .row__main small { white-space: normal; }
.pt-opts { display: grid; gap: 8px; }
.pt-inv { display: grid; }
.pt-inv__row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pt-inv__row:last-child { border-bottom: 0; }
.pt-docs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.pt-doc { min-width: 0; width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-control); border: 1px solid var(--line); background: var(--surface-2); text-align: left; color: var(--accent-ink); }
.pt-doc:hover { border-color: var(--accent); background: var(--accent-soft); }
.pt-doc svg { width: 17px; height: 17px; flex: none; }
.pt-msgs { display: grid; gap: 8px; max-height: 260px; overflow-y: auto; }
.pt-msg { justify-self: start; max-width: 88%; padding: 10px 12px; border-radius: var(--r-control); background: var(--surface-3); }
.pt-msg.is-us { justify-self: end; background: var(--accent-soft); }
.pt-msg small { font-size: 11px; color: var(--muted); }
.pt-msg p { font-size: var(--fs-sm); color: var(--ink); line-height: 1.45; margin-top: 2px; }
.pt-reply { display: grid; gap: 8px; }
.pt-reply .textarea { min-height: 56px; }
.pt-warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-control); background: var(--warn-soft); color: var(--warn-ink); font-size: var(--fs-xs); line-height: 1.45; }
.pt-warn svg { width: 16px; height: 16px; flex: none; }
.pt-warn[hidden] { display: none; }
@media (max-width: 1100px) { .pt-grid, .pt-grid--q, .pt-grid--3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .pt-page { padding: 12px; max-height: none; }
  .pt-steps { grid-template-columns: repeat(9, 64px); overflow-x: auto; padding-bottom: 4px; }
  .pt-nav span { display: none; }
  .pt-top { gap: 8px; padding: 10px 12px; }
  .pt-chooser .filter__n { display: none; }
}

/* ---------- Change requests ---------- */
.pt-type { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ink-2); }
.pt-type svg { width: 14px; height: 14px; color: var(--c, var(--accent-ink)); }
.pt-checks { display: inline-flex; align-items: center; gap: 8px; min-width: 96px; }
.pt-checks .meter { flex: 1; height: 6px; min-width: 40px; }
.pt-checks small { font-size: var(--fs-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pt-flag { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-control); background: var(--bad-soft); color: var(--bad-ink); font-size: var(--fs-sm); line-height: 1.45; }
.pt-flag svg { width: 18px; height: 18px; flex: none; }
.pt-files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pt-file { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--accent-ink); }
.pt-file svg { width: 12px; height: 12px; }
.pt-thread { display: grid; gap: 10px; max-height: calc(100vh - 430px); min-height: 160px; overflow-y: auto; }
.pt-thread .pt-msg { max-width: 80%; }
.pt-nps { display: flex; gap: 4px; align-items: flex-end; height: 150px; }
.pt-nps div { flex: 1; display: grid; gap: 4px; justify-items: center; align-content: end; height: 100%; }
.pt-nps i { width: 100%; border-radius: var(--r-small) var(--r-small) 0 0; background: var(--c); min-height: 3px; }
.pt-nps small { font-size: 11px; color: var(--muted); }
.pt-score { display: flex; align-items: baseline; gap: 8px; }
.pt-score b { font: 800 var(--fs-3xl) var(--font-head); color: var(--ink); }
.pt-fb { display: grid; gap: 0; max-height: calc(100vh - 360px); overflow-y: auto; }
.pt-fb .row { align-items: flex-start; }
.pt-fb .row__main small, .pt-fb .row__main p { white-space: normal; }
.pt-fb p { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
.pt-sc { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: var(--r-dot); font: 800 var(--fs-sm) var(--font-head); color: #fff; background: var(--c); }
.pt-nps div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.pt-thread { align-content: start; }
@media (max-width: 760px) {
  .pt-chooser { display: grid; gap: 8px; }
  .pt-chooser .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .pt-chooser [data-ptopen] { justify-self: start; }
}
