/* The brand portal (docs/ops/brand-portal.md): log in, invites and a brand's
   page. Cream page, white rows, Fraunces headings and a dark primary button,
   after the matcha-works demo. Everything is scoped under .pt. */

.pt-body {
  --pt-bg: #f7f6f2;
  --pt-panel: #ffffff;
  --pt-ink: #1e1c16;
  --pt-muted: #6a665b;
  --pt-line: #e4e1d8;
  --pt-dark: #1e1c16;
  --pt-broken: #b3261e;
  --pt-broken-soft: #fbe9e7;
  --pt-improve: #c2690f;
  --pt-improve-soft: #fbeedc;
  --pt-look: #a68a00;
  --pt-look-soft: #f8f1cf;
  --pt-good: #1f7a55;
  --pt-good-soft: #e2f1e9;
  --pt-mustard: #d9a520;
  background: var(--pt-bg);
  color: var(--pt-ink);
  margin: 0;
}

.pt { font-family: var(--font-sans); min-height: 100vh; }
.pt h1, .pt h2 { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.01em; }
.pt a { color: inherit; }
.pt-soft { color: var(--pt-muted); }
.pt-small { font-size: 14px; }

.pt-wordmark { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 900; font-size: 22px; text-decoration: none; }
.pt-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pt-mustard); }
.pt-mark { display: inline-flex; align-items: center; gap: 8px; }
.pt-beta { font: 700 11px var(--font-mono, ui-monospace, monospace); letter-spacing: 0.08em; text-transform: uppercase; color: #7a5a00; background: #f6ecc9; border-radius: 999px; padding: 3px 8px; }

/* Buttons */
.pt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--pt-dark); background: var(--pt-dark); color: #fff; font: 600 15px/1.2 var(--font-sans); text-decoration: none; cursor: pointer; }
.pt-btn:hover { background: #000; }
.pt-btn:disabled { opacity: 0.6; cursor: progress; }
.pt-btn-alt { background: var(--pt-panel); color: var(--pt-ink); border-color: var(--pt-line); }
.pt-btn-alt:hover { background: #f1efe9; }
.pt-btn-ghost { background: transparent; color: var(--pt-ink); border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.pt-btn-ghost:hover { background: transparent; color: #000; }
.pt-btn-wide { width: 100%; }
.pt-link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--pt-muted); text-decoration: underline; cursor: pointer; }
.pt :focus-visible { outline: 3px solid var(--pt-mustard); outline-offset: 2px; }

/* Card pages: log in, invites, picker */
.pt-auth-top { padding: 20px 24px; }
.pt-auth-main { display: grid; place-items: start center; padding: 24px 16px 64px; }
.pt-card { width: 100%; max-width: 420px; background: var(--pt-panel); border: 1px solid var(--pt-line); border-radius: 16px; padding: 28px 24px; box-shadow: 0 8px 24px rgb(30 28 22 / 6%); }
.pt-card h1 { font-size: 30px; line-height: 1.1; margin: 0 0 12px; }
.pt-form { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.pt-form label { font-size: 14px; font-weight: 600; color: var(--pt-muted); }
.pt-form input, .pt-fb textarea { font: 16px/1.4 var(--font-sans); padding: 10px 12px; border: 1px solid var(--pt-line); border-radius: 10px; background: #fff; color: var(--pt-ink); }
.pt-form .pt-btn { margin-top: 8px; }
.pt-msg { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--pt-broken-soft); color: var(--pt-broken); font-size: 14px; }
.pt-or { display: flex; align-items: center; gap: 12px; color: var(--pt-muted); font-size: 13px; margin: 8px 0; }
.pt-or::before, .pt-or::after { content: ""; flex: 1; border-top: 1px solid var(--pt-line); }
.pt-picker { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; }
.pt-picker a { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--pt-line); border-radius: 12px; text-decoration: none; font-weight: 600; }

.pt-initials { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e8efe6; color: #2f5a2a; font: 700 12px/1 var(--font-sans); }

/* Brand page header */
.pt-top { background: var(--pt-panel); border-bottom: 1px solid var(--pt-line); }
.pt-top-in { max-width: 860px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pt-brand { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--pt-line); border-radius: 999px; font-weight: 600; font-size: 15px; }
.pt-me { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; }
.pt-me form { margin: 0; }
.pt-banner { background: var(--pt-improve-soft); color: #6b3a07; padding: 10px 16px; font-size: 14px; text-align: center; }

.pt-main { max-width: 860px; margin: 0 auto; padding: 28px 16px 64px; }
.pt-hello h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.05; margin: 0 0 16px; }
.pt-ask { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 14px; background: var(--pt-panel); border: 1.5px solid var(--pt-ink); border-radius: 22px; }
.pt-ask:focus-within { box-shadow: 0 0 0 3px var(--pt-mustard); }
.pt-ask textarea { width: 100%; min-height: 72px; resize: vertical; border: 0; padding: 4px 6px; background: transparent; color: var(--pt-ink); font: 18px/1.45 var(--font-sans); }
.pt-ask textarea:focus { outline: none; }
.pt-ask textarea::placeholder { color: #a39f93; }
.pt-ask-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.pt-ask-count { margin-right: auto; font-size: 13px; color: var(--pt-muted); }
.pt-ask-btn { min-height: 46px; padding: 10px 22px; border-radius: 14px; font-size: 16px; }
.pt-ask-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pt-ask-state { margin: 0; font-size: 14px; color: var(--pt-good); }
.pt-ask-state:empty { display: none; }
.pt-ask-bad { color: var(--pt-broken) !important; }

.pt-tabs { position: relative; margin: 28px 0 14px; border-bottom: 1px solid var(--pt-line); }
.pt-tabs::after { content: ""; position: absolute; top: 0; right: 0; bottom: 1px; width: 28px; background: linear-gradient(to right, transparent, var(--pt-bg)); pointer-events: none; }
.pt-tabs-in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-right: 24px; }
.pt-tabs-in::-webkit-scrollbar { display: none; }
.pt-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--pt-muted); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.pt-tab:hover { color: var(--pt-ink); }
.pt-tab[aria-current="page"] { color: var(--pt-ink); border-bottom-color: var(--pt-mustard); }
.pt-tab-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #ece9df; color: var(--pt-ink); font-size: 12px; font-weight: 700; }
.pt-tab[aria-current="page"] .pt-tab-n { background: var(--pt-dark); color: #fff; }

/* Filter pills */

/* The list */
.pt-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pt-item { background: var(--pt-panel); border: 1px solid var(--pt-line); border-left: 5px solid var(--pt-line); border-radius: 14px; overflow: hidden; }
.pt-item[hidden] { display: none; }
.pt-pri-broken { border-left-color: var(--pt-broken); }
.pt-pri-improve { border-left-color: var(--pt-improve); }
.pt-pri-look { border-left-color: var(--pt-look); }
.pt-pri-good { border-left-color: var(--pt-good); }
.pt-toggle { width: 100%; display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.pt-summary { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pt-head { font-size: 17px; line-height: 1.4; }
.pt-head strong { font-weight: 700; }
.pt-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; color: var(--pt-muted); }
.pt-pri { font-weight: 700; }
.pt-pri-broken .pt-pri { color: var(--pt-broken); }
.pt-pri-improve .pt-pri { color: var(--pt-improve); }
.pt-pri-look .pt-pri { color: var(--pt-look); }
.pt-pri-good .pt-pri { color: var(--pt-good); }
.pt-val { color: var(--pt-ink); font-weight: 600; }
.pt-status:empty { display: none; }
.pt-status { font-weight: 600; }
.pt-chev { width: 10px; height: 10px; margin-top: 6px; border-right: 2px solid var(--pt-muted); border-bottom: 2px solid var(--pt-muted); transform: rotate(45deg); transition: transform var(--dur, 200ms) var(--ease-out, ease); flex: none; }
.pt-item[data-open] .pt-chev { transform: rotate(-135deg); }

/* The status mark: an empty ring waiting, a half disc in progress, a tick when done or working well. */
.pt-check { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--pt-line); position: relative; }
.pt-check-in_progress { border-color: var(--pt-dark); background: linear-gradient(90deg, var(--pt-dark) 50%, transparent 50%); }
.pt-check-complete, .pt-check-working_well { border-color: var(--pt-good); background: var(--pt-good); }
.pt-check-complete::after, .pt-check-working_well::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); }

/* The open row */
.pt-detail { padding: 0 18px 18px 54px; display: flex; flex-direction: column; gap: 16px; }
.pt-detail[hidden] { display: none; }
.pt-block h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--pt-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pt-text p { margin: 0 0 8px; line-height: 1.55; }
.pt-list-items, .pt-detail .pt-list { margin: 0; padding-left: 20px; }
.pt-cap { margin: 0 0 8px; font-weight: 600; }
.pt-told { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--pt-improve-soft); font-size: 14px; }

.pt-stats dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 0; }
.pt-stats dl div { padding: 12px; border: 1px solid var(--pt-line); border-radius: 10px; background: #fbfaf7; }
.pt-stats dt { font-family: var(--font-display); font-weight: 900; font-size: 24px; }
.pt-stats dd { margin: 4px 0 0; font-size: 14px; color: var(--pt-muted); }

.pt-flow { margin: 0; padding: 12px; border: 1px solid var(--pt-line); border-radius: 12px; background: #fbfaf7; }
.pt-flow ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pt-step { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--pt-line); }
.pt-step-kind { font-size: 13px; font-weight: 700; color: var(--pt-muted); }
.pt-step-bad { border-color: var(--pt-broken); }
.pt-step-problem { grid-column: 2; font-size: 14px; color: var(--pt-broken); }
.pt-flow figcaption { margin-top: 8px; font-size: 13px; color: var(--pt-muted); }

.pt-changes { display: flex; flex-direction: column; gap: 10px; }
.pt-change-where { margin: 0 0 6px; font-weight: 600; font-size: 14px; }
.pt-ab { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pt-ab > div { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--pt-line); }
.pt-ab span { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pt-muted); margin-bottom: 4px; }
.pt-ab p { margin: 0; font-size: 14px; line-height: 1.45; }
.pt-now { background: #fbfaf7; }
.pt-after { background: var(--pt-good-soft); border-color: #c5e3d3 !important; }

.pt-shot { margin: 0; }
.pt-shot img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--pt-line); }
.pt-shot figcaption { font-size: 13px; color: var(--pt-muted); margin-top: 6px; }

.pt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; border-top: 1px solid var(--pt-line); padding-top: 14px; }
.pt-note { margin: 0; font-weight: 600; font-size: 15px; }
.pt-note-done { color: var(--pt-good); }
.pt-thumbs { margin-left: auto; display: inline-flex; gap: 4px; }
.pt-thumb { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--pt-line); background: #fff; font-size: 17px; cursor: pointer; }
.pt-thumb[aria-pressed="true"] { background: var(--pt-dark); border-color: var(--pt-dark); }
.pt-state { margin: 0; font-size: 14px; color: var(--pt-muted); }
.pt-state:empty { display: none; }

.pt-fb { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--pt-line); border-radius: 12px; background: #fbfaf7; }
.pt-fb[hidden] { display: none; }
.pt-fb p { margin: 0; }
.pt-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-reason input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pt-reason span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--pt-line); background: #fff; font-size: 14px; cursor: pointer; }
.pt-reason input:checked + span { background: var(--pt-dark); color: #fff; border-color: var(--pt-dark); }
.pt-reason input:focus-visible + span { outline: 3px solid var(--pt-mustard); outline-offset: 2px; }
.pt-row-btns { display: flex; gap: 8px; }

.pt-empty { margin: 16px 0; color: var(--pt-muted); }

/* Finding more */
.pt-more { margin-top: 28px; padding: 18px; border: 1px dashed var(--pt-line); border-radius: 14px; }
.pt-more-h { margin: 14px 0 6px; font-weight: 700; }
.pt-more p.pt-small { margin: 0; line-height: 1.5; }
.pt-progress { height: 6px; border-radius: 999px; background: #ece9df; overflow: hidden; }
.pt-progress span { display: block; width: 35%; height: 100%; border-radius: 999px; background: var(--pt-mustard); animation: pt-slide 2.4s ease-in-out infinite; }
@keyframes pt-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .pt-progress span { animation: none; width: 100%; opacity: 0.5; } }
.pt-foot { margin-top: 28px; font-size: 14px; color: var(--pt-muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pt-foot p { margin: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Phones: the evidence stacks */
@media (max-width: 560px) {
  .pt-detail { padding: 0 14px 16px; }
  .pt-toggle { padding: 14px; }
  .pt-ab { grid-template-columns: 1fr; }
  .pt-step { grid-template-columns: 1fr; }
  .pt-step-problem { grid-column: 1; }
  .pt-thumbs { margin-left: 0; }
  .pt-actions .pt-btn { flex: 1 1 100%; }
  .pt-me { margin-left: 0; width: 100%; justify-content: space-between; }
}
