/* Team, setup, help, demo mode and the installable app (17 Oct 2026). Built on app.css's tokens and components. */

/* Guests: every page shows, but the buttons that would change something are hidden (the server refuses them anyway) */
body.ro .work form[method="post"]:not([data-ro-ok]) :is(button, input[type="submit"]),
body.ro .pbar form.ask { display: none !important; }
.rolebar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--mark) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--mark) 45%, var(--line)); font-size: var(--fs-md); }
.rolebar > svg { width: 18px; height: 18px; flex: none; }
.rolebar > span { flex: 1 1 260px; min-width: 0; }
.rolebar .btn { min-height: 40px; padding: 8px 14px; }

/* Team page */
.copyline { flex-wrap: nowrap; }
.copyline input.code { flex: 1; min-width: 0; min-height: 44px; color: var(--ink); }
.ok-panel { border-color: color-mix(in srgb, var(--fresh) 45%, var(--line)); }
.roles-pick { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.roles-pick legend { padding: 0; margin-bottom: 6px; font-size: var(--fs-sm); font-weight: 600; }
.roles-pick .check { padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.roles-pick .check:has(input:checked) { border-color: var(--ink); }
.roles-pick .check span { display: grid; gap: 2px; }
.roles-pick .check small { color: var(--muted); font-size: var(--fs-sm); }
.team-tbl td, .team-tbl th { vertical-align: middle; }
.team-tbl th[scope="row"] { color: var(--ink); font-weight: 600; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.role-f { display: flex; gap: 6px; align-items: center; }
.role-f select { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1.5px solid var(--field); background: var(--surface); color: var(--ink); }
.role-f .btn { min-height: 40px; padding: 6px 12px; }
.confirm-d > summary { list-style: none; min-height: 40px; padding: 6px 10px; }
.confirm-d > summary::-webkit-details-marker { display: none; }
.confirm-d[open] form { display: grid; gap: 6px; padding-top: 6px; justify-items: start; }
.perm-tbl th[scope="row"] { color: var(--ink); font-weight: 500; font-size: var(--fs-sm); }
.perm-tbl td { text-align: center; width: 84px; }
.perm-tbl td svg { width: 18px; height: 18px; color: var(--fresh); vertical-align: -3px; }
.perm-tbl thead th:not(:first-child) { text-align: center; }

/* Home: the setup checklist and the sample-brand tour */
.setup-bar { height: 8px; border-radius: 999px; background: var(--tile); overflow: hidden; }
.setup-bar i { display: block; height: 100%; border-radius: 999px; background: var(--mark); }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.setup-steps li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.setup-steps li:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 900px) {
  .card.setup .setup-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .card.setup .setup-steps li:nth-child(2) { border-top: 0; padding-top: 0; }
}
.setup-steps .tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--field); display: grid; place-items: center; margin-top: 1px; }
.setup-steps .tick svg { width: 14px; height: 14px; }
.setup-steps li.done .tick { background: var(--fresh); border-color: var(--fresh); color: var(--on-fresh); }
.setup-steps li.done b { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.setup-steps li.next .tick { border-color: var(--ink); border-width: 2px; }
.setup-steps a { display: grid; gap: 2px; color: inherit; text-decoration: none; min-height: 44px; }
.setup-steps a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.setup-steps small { color: var(--muted); font-size: var(--fs-sm); }
.home .card.setup > form, .home .card.tour form { margin: 0; }
.home .card.setup > form .btn { padding-inline: 10px; }
.card.tour { border-color: color-mix(in srgb, var(--mark) 45%, var(--line)); }
.card.setup .chip { font-variant-numeric: lining-nums tabular-nums; }

/* Onboarding: competitors */
.picks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.picks li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.picks b { display: block; overflow-wrap: anywhere; }
.picks small { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: lining-nums tabular-nums; }
.picks form { margin: 0; }
.picks .btn { min-height: 40px; padding: 8px 14px; }
.picks li.on { border-color: color-mix(in srgb, var(--fresh) 45%, var(--line)); }

/* Plan page additions */
.pay-alt { display: grid; gap: 4px; }
.pay-alt small { color: var(--muted); font-size: var(--fs-sm); }
.seat-f { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.seat-f .field { width: 140px; }

/* Help */
.help-search { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--field); background: var(--surface); color: var(--ink); }
.help-group { display: grid; gap: 8px; }
.help-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.help-list a { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: inherit; text-decoration: none; }
.help-list a:hover { border-color: var(--field); }
.help-list small { color: var(--muted); font-size: var(--fs-sm); }
.help-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.doc table.tbl { font-size: var(--fs-sm); }
.doc .tbl td, .doc .tbl th { vertical-align: top; }
.doc .howto { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.doc dl.wins { margin: 0; display: grid; gap: 10px; }
.doc dl.wins dt { font-weight: 700; }
.doc dl.wins dd { margin: 0; color: var(--muted); }

/* Demo mode: names blurred on screen, for screen-sharing. Hidden until the page script has done its pass. */
html.demo-pending body { visibility: hidden; }
html.demo-failed body > * { filter: blur(8px); }   /* the script didn't run: blur everything rather than show names */
.demo-blur { filter: blur(6px); user-select: none; }
html.demo .switch-ic, html.demo .switch b, html.demo .switch .small { filter: blur(6px); }
.demo-pill { position: fixed; z-index: 60; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center;
  padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: var(--fs-sm); font-weight: 600; box-shadow: 0 6px 20px rgb(0 0 0 / .25); }
.demo-pill button { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 0; background: var(--mark); color: var(--on-mark); font-weight: 700; cursor: pointer; }
@media (max-width: 760px) { .demo-pill { bottom: calc(76px + env(safe-area-inset-bottom)); } }
@media print { .demo-pill { display: none; } }

/* Onboarding: the sample data way in */
.sample-try { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.team-seats, .team-add { align-content: start; }
.doc .tbl th[scope="row"] { color: var(--ink); font-size: var(--fs-sm); font-weight: 500; }
@media (max-width: 640px) {   /* phones: each person is a short stack, not a squeezed table */
  .team-tbl thead { display: none; }
  .team-tbl, .team-tbl tbody, .team-tbl tr, .team-tbl th, .team-tbl td { display: block; }
  .team-tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .tbl.team-tbl :is(th, td) { border: 0; padding: 0; }
  .team-tbl th[scope="row"] { grid-column: 1 / -1; }
  .team-tbl td:nth-child(3) { color: var(--muted); font-size: var(--fs-xs); text-align: right; }
  .team-tbl td:nth-child(3)::before { content: "Joined "; }
  .team-tbl td:nth-child(4) { grid-column: 1 / -1; }
  .team-tbl td:nth-child(4):empty { display: none; }
}
