/* Help button and panel, shared by the punch list, Builder portfolio, Crew projects and
   Help requests pages. Colors are literal so the file works beside any page's variables. */
/* Double tap never zooms the page; pinch still does. A quick second tap on a
   button or card stays a tap. */
html { touch-action: manipulation; }
.help-dialog, .help-dialog *, .help-requests-page, .help-requests-page * { box-sizing: border-box; }
.help-button {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 0;
  border: 1px solid #ddd8d1;
  border-radius: 50%;
  color: #686868;
  background: #fff;
  font: 700 17px/1 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}
.help-button:hover, .help-button:focus-visible { border-color: #c9bdb3; color: #171717; }
.help-button:focus-visible { outline: 3px solid rgba(23, 23, 23, .28); outline-offset: 2px; }
.help-button.has-unread::after {
  content: attr(data-unread);
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #c83e49;
  font-size: 11px;
}

.help-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: min(86dvh, 760px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  color: #171717;
  background: #fff;
  box-shadow: 0 18px 50px rgba(42, 32, 28, .18);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: contain;
}
.help-dialog::backdrop { background: rgba(23, 23, 23, .42); }
/* The page behind stays put while Help is open. */
html.help-open, html.help-open body { overflow: hidden; overscroll-behavior: none; }
.help-grabber { display: none; }
.help-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #ece8e2;
  background: #fff;
}
.help-title { margin: 0; font-size: 20px; }
.help-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #686868;
  background: #f1efeb;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.help-section { padding: 14px 18px; }
.help-section + .help-section { border-top: 1px solid #ece8e2; }
.help-section-title {
  margin: 0 0 6px;
  color: #686868;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.help-screen-text { margin: 0; }
.help-form { display: grid; gap: 8px; }
.help-label { font-weight: 600; }
.help-input {
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid #ddd8d1;
  border-radius: 12px;
  color: inherit;
  background: #fff;
  font: inherit;
  font-size: 16px;
}
.help-input:focus { border-color: #9a8f86; outline: 3px solid rgba(23, 23, 23, .12); }
.help-primary, .help-secondary {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.help-primary { justify-self: start; border: 0; color: #fff; background: #171717; }
.help-secondary { border: 1px solid #ddd8d1; color: #171717; background: #fff; }
.help-primary:disabled, .help-secondary:disabled { cursor: default; opacity: .55; }
.help-conversation { display: grid; gap: 12px; margin: 0 0 12px; padding: 0; list-style: none; }
.help-conversation:empty { display: none; }
.help-turn { display: grid; gap: 8px; }
.help-turn-question {
  justify-self: end;
  max-width: 85%;
  margin: 0;
  padding: 8px 12px;
  border-radius: 14px 14px 4px 14px;
  color: #fff;
  background: #171717;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.help-turn-answer { max-width: 100%; padding: 12px 14px; border-radius: 14px 14px 14px 4px; background: #f6f4f0; }
.help-turn-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.help-turn-hint { margin: 10px 0 0; color: #686868; font-size: 14px; }
.help-thinking { display: flex; align-items: center; gap: 10px; min-height: 32px; color: #686868; }
.help-hammer { flex: 0 0 32px; width: 32px; height: 32px; overflow: visible; }
.help-hammer-board { fill: #d9cfc4; }
.help-hammer-nail { fill: #8a8178; animation: help-nail 1.1s ease-in infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.help-hammer-handle { fill: #8b5a3c; }
.help-hammer-metal { fill: #c83e49; }
.help-hammer-head { animation: help-hammer 1.1s ease-in infinite; transform: rotate(38deg); transform-origin: 44px 26px; }
@keyframes help-hammer {
  0%, 45%, 100% { transform: rotate(38deg); }
  62% { transform: rotate(0deg); }
  74% { transform: rotate(6deg); }
}
@keyframes help-nail {
  0%, 60% { transform: scaleY(1); }
  66%, 100% { transform: scaleY(.82); }
}
@media (prefers-reduced-motion: reduce) {
  .help-hammer-head, .help-hammer-nail { animation: none; }
  .help-hammer-head { transform: rotate(20deg); }
}
.help-quiet-link {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 0;
  border: 0;
  color: #686868;
  background: none;
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.help-quiet-link:hover { color: #171717; }
.help-quiet-link:focus-visible, .help-primary:focus-visible { outline: 3px solid rgba(23, 23, 23, .28); outline-offset: 2px; }
.help-send { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #e6e1da; }
.help-send-label { font-size: 14px; font-weight: 600; }
.help-send .help-input { min-height: 64px; }
.help-sent { color: #1f6b3a; }
.help-mine-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.help-mine-item { padding: 10px 12px; border: 1px solid #ece8e2; border-radius: 12px; }
.help-mine-item.unread { border-color: #c83e49; background: #fdf5f6; }
.help-mine-item p { margin: 0; }
.help-mine-question { font-weight: 600; }
.help-mine-answer { margin-top: 6px !important; white-space: pre-line; }
.help-mine-by, .help-mine-waiting { margin-top: 4px !important; color: #686868; font-size: 13px; }
.help-team-link {
  display: block;
  padding: 14px 18px 18px;
  border-top: 1px solid #ece8e2;
  color: #171717;
  font-weight: 700;
}
.help-team-link[hidden], .help-mine[hidden], .help-ask[hidden], .help-turn-hint[hidden] { display: none; }

@media (max-width: 520px) {
  .help-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .help-header { position: sticky; padding-top: 22px; touch-action: none; }
  .help-grabber {
    position: absolute;
    top: 8px;
    left: 50%;
    display: block;
    width: 40px;
    height: 5px;
    border-radius: 999px;
    background: #d6d0c8;
    transform: translateX(-50%);
  }
}

/* Help requests page (Carbide team only). */
.help-requests-page { margin: 0; min-height: 100dvh; color: #171717; background: #f1efeb; font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.help-requests-top {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between;
  max-width: 820px; margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) 18px 8px;
}
.help-requests-top h1 { margin: 0; font-size: 28px; line-height: 1.15; }
.help-requests-eyebrow { margin: 0; color: #686868; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.help-requests-main { max-width: 820px; margin: 0 auto; padding: 8px 18px calc(32px + env(safe-area-inset-bottom)); }
.help-requests-status { margin: 0 0 12px; color: #686868; }
.help-requests-tabs { display: inline-flex; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 12px; background: #e6e2dc; }
.help-requests-tabs button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 9px; color: #171717; background: transparent; font: inherit; font-weight: 600; cursor: pointer; }
.help-requests-tabs button.selected { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.help-requests-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.help-request { display: grid; gap: 8px; padding: 16px; border: 1px solid #ddd8d1; border-radius: 16px; background: #fff; }
.help-request.status-open { border-left: 5px solid #c83e49; }
.help-request.status-answered { border-left: 5px solid #1769aa; }
.help-request.status-done { opacity: .85; }
.help-request p { margin: 0; }
.help-request-status { justify-self: start; padding: 2px 10px; border-radius: 999px; color: #686868; background: #f1efeb; font-size: 12px; font-weight: 700; }
.help-request.status-open .help-request-status { color: #a72f3a; background: #fae9eb; }
.help-request-meta, .help-request-note { color: #686868; font-size: 13px; }
.help-request-question { font-size: 17px; font-weight: 600; white-space: pre-line; }
.help-request-agent { padding: 8px 12px; border-radius: 10px; background: #f6f4f0; }
.help-request-agent summary { cursor: pointer; font-weight: 600; }
.help-request-agent p { margin-top: 6px; white-space: pre-line; }
.help-request-form { display: grid; gap: 8px; }
.help-request-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.help-sign-in { display: grid; gap: 12px; justify-items: start; margin: 0 0 16px; padding: 18px; border: 1px solid #e4dfd8; border-radius: 16px; background: #fff; }
.help-sign-in[hidden] { display: none; }
.help-sign-in p { margin: 0; color: #3c3c3c; line-height: 1.45; }
.help-sign-in a.help-primary { display: inline-flex; align-items: center; text-decoration: none; }
.help-requests-tabs[hidden] { display: none; }
.help-sign-in a.help-primary[hidden], .help-sign-in [hidden] { display: none; }

/* The owner's Early access page (early-access.html) reuses the Help requests page layout. */
.ea-funnel { margin: 0 0 16px; padding: 16px; border: 1px solid #ddd8d1; border-radius: 16px; background: #fff; }
.ea-funnel[hidden], .ea-unfinished[hidden] { display: none; }
.ea-funnel h2, .ea-unfinished h2 { margin: 0 0 10px; font-size: 17px; }
.ea-funnel-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.ea-funnel-step { display: grid; gap: 2px; padding: 10px; border-radius: 10px; background: #f6f4f0; }
.ea-funnel-step strong { font-size: 18px; }
.ea-funnel-step span { color: #3c3c3c; font-size: 13px; line-height: 1.3; }
.ea-company.ea-stopped { border-left: 5px solid #c88a1e; }
.ea-company.ea-stopped .help-request-status { color: #7a4f00; background: #fbf1dc; }
.ea-company.ea-all-done { border-left: 5px solid #2f7d4f; }
.ea-company.ea-all-done .help-request-status { color: #22603b; background: #e3f2e8; }
.ea-company a, .ea-unfinished-row a { color: inherit; overflow-wrap: anywhere; }
.ea-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.ea-step { display: flex; align-items: baseline; gap: 6px; padding: 6px 10px; border-radius: 10px; color: #8a8a8a; background: #f6f4f0; font-size: 13px; }
.ea-step.done { color: #171717; background: #eef6f0; }
.ea-step.next { color: #7a4f00; background: #fbf1dc; font-weight: 600; }
.ea-step-mark { width: 1em; text-align: center; font-weight: 700; }
.ea-step.done .ea-step-mark { color: #2f7d4f; }
.ea-step-date { margin-left: auto; color: #686868; font-size: 12px; white-space: nowrap; }
.ea-unfinished { margin-top: 24px; }
.ea-company.ea-attention { border-left: 5px solid #c83e49; }
.ea-company.ea-attention .help-request-status { color: #a72f3a; background: #fae9eb; }
.ea-weeks { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; align-items: end; margin: 0; padding: 0; list-style: none; }
.ea-week { display: grid; gap: 4px; justify-items: center; text-align: center; }
.ea-week strong { font-size: 15px; }
.ea-week-bar { width: 100%; max-width: 44px; height: calc(4px + 56px * var(--ea-week-fill, 0)); border-radius: 6px 6px 2px 2px; background: #2f7d4f; }
.ea-week-label { display: grid; color: #686868; font-size: 11px; line-height: 1.25; white-space: nowrap; }
