/* Shared appearance for help, equipment instructions and the site FAQ. */
:where(#owner-help, .pos-help-topics, .agent-install, .agent-install-routes,
       .remote-print-main, .ic-notice, .guest-setup, #scanner-check-status, .faq-list,
       .access-note, .owner-start-help, .auth-hint, .help-text, .field-hint,
       .floor-editor-canvas-help, .signup-terms, .story-details, .equipment-details) {
  --help-ink: #272339;
  --help-muted: #59546c;
  --help-accent: #5144aa;
  --help-border: #e5e0ee;
  --help-active-border: #d7cff3;
  --help-surface: #fff;
  --help-tint: #f7f5fc;
  --help-radius: 14px;
}

:where(.owner-help-questions, .pos-help-topics, .faq-list) {
  display: grid;
  gap: 8px;
}

.remote-print-install,
:is(.owner-help-questions, .pos-help-topics, .agent-install, .faq-list) details {
  padding: 0;
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius);
  background: var(--help-surface);
}

:is(.owner-help-questions, .pos-help-topics, .agent-install, .faq-list) details[open],
.remote-print-install[open] {
  border-color: var(--help-active-border);
  background: var(--help-tint);
}

:is(.owner-help-questions, .pos-help-topics, .agent-install, .faq-list) details > summary,
.remote-print-install > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: calc(var(--help-radius) - 1px);
  color: var(--help-ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: rgb(81 68 170 / 12%);
}

:is(.owner-help-questions, .pos-help-topics, .agent-install, .faq-list) summary::-webkit-details-marker,
.remote-print-install > summary::-webkit-details-marker {
  display: none;
}

:is(.owner-help-questions, .pos-help-topics, .agent-install) details > summary::after,
.remote-print-install > summary::after {
  content: "";
  flex: 0 0 7px;
  height: 7px;
  margin-inline: 5px;
  border: solid var(--help-accent);
  border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}

:is(.owner-help-questions, .pos-help-topics, .agent-install) details[open] > summary::after,
.remote-print-install[open] > summary::after {
  transform: translateY(2px) rotate(225deg);
}

:is(.owner-help-questions, .pos-help-topics, .agent-install, .faq-list) details[open] > summary,
.remote-print-install[open] > summary {
  color: var(--help-accent);
}

:is(.owner-help-questions, .pos-help-topics, .agent-install, .faq-list) details > summary:focus-visible,
.remote-print-install > summary:focus-visible {
  outline: 2px solid var(--help-accent);
  outline-offset: -3px;
}

@media (hover: hover) {
  :is(.owner-help-questions, .pos-help-topics, .agent-install, .faq-list) details > summary:hover,
  .remote-print-install > summary:hover {
    background: var(--help-tint);
    color: var(--help-accent);
  }
}

:is(.owner-help-questions, .pos-help-topics, .agent-install, .faq-list) details > p,
.remote-print-install > p {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--help-muted);
  font-size: 14px;
  line-height: 1.6;
}

#owner-help .owner-help-head {
  box-shadow: 0 4px 12px rgb(39 35 57 / 5%);
}

#owner-help-title:focus {
  outline: none;
}

#owner-help .owner-help-body {
  padding-block-start: 16px;
}

#owner-help [data-owner-settings-guide] {
  margin-block-start: 0;
  border-block-end: 0;
}

#owner-help .owner-help-topics {
  gap: 8px;
}

.owner-help-topics > div {
  padding: 12px 14px;
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius);
  background: var(--help-tint);
}

#owner-help .owner-help-topics dt {
  color: var(--help-ink);
  font-size: 15px;
  font-weight: 700;
}

#owner-help .owner-help-topics dd {
  color: var(--help-muted);
  font-size: 14px;
}

#owner-help a {
  color: var(--help-accent);
  font-weight: 650;
}

#owner-help :is(a, button):focus-visible {
  outline: 2px solid var(--help-accent);
  outline-offset: 3px;
}

#owner-help [data-manager-settings-guide],
#scanner-check-status {
  border: 1px solid var(--help-active-border);
  border-radius: var(--help-radius);
  background: var(--help-tint);
  color: var(--help-muted);
}

#owner-help [data-manager-settings-guide] {
  margin: 0 0 16px;
  padding: 12px 14px;
}

.agent-install > details {
  margin-block-end: 16px;
}

.agent-install .agent-install-note, .ic-notice {
  border: 1px solid var(--help-active-border);
  border-radius: var(--help-radius);
  background: var(--help-tint);
  color: var(--help-muted);
  line-height: 1.6;
}

.agent-install .agent-install-limit {
  border-radius: var(--help-radius);
  line-height: 1.6;
}

.agent-install .agent-install-next {
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius);
  background: var(--help-tint);
}

.agent-install-routes a {
  border-color: var(--help-border);
  border-radius: var(--help-radius);
  color: var(--help-accent);
}

.agent-install-routes a[href="/remote-print"] {
  background: var(--help-tint);
}

:is(.agent-install, .remote-print-install) ol {
  padding-inline-start: 1.45em;
  color: var(--help-muted);
  line-height: 1.6;
}

:is(.agent-install, .remote-print-install) ol > li::marker {
  color: var(--help-accent);
  font-weight: 750;
}

.remote-print-install > :is(h3, ol, label, input, button) {
  margin-inline: 14px;
}

.remote-print-install a {
  color: var(--help-accent);
  font-weight: 650;
  text-underline-offset: 3px;
}

.remote-print-install a:focus-visible {
  outline: 2px solid var(--help-accent);
  outline-offset: 3px;
}

.remote-print-install > input {
  width: calc(100% - 28px);
}

.remote-print-install[open] {
  padding-block-end: 14px;
}

.remote-print-step {
  border-color: var(--help-active-border);
  border-radius: var(--help-radius);
  background: var(--help-tint);
}

#scanner-check-status {
  margin-block: 8px 0;
  min-height: 44px;
  padding: 10px 12px;
  line-height: 1.5;
}

.guest-setup [data-guest-status]:not(:empty) {
  padding: 10px 14px;
  border: 1px solid var(--help-active-border);
  border-radius: var(--help-radius);
  background: var(--help-tint);
  color: var(--help-muted);
}

.faq-list {
  border-top: 0;
}

:is(.story-details, .equipment-details) {
  padding-inline: 16px;
  border: 1px solid var(--help-border);
  border-radius: var(--help-radius);
  background: var(--help-surface);
}

:is(.story-details, .equipment-details)[open] {
  border-color: var(--help-active-border);
}

:is(.story-details, .equipment-details) > summary:focus-visible {
  outline: 2px solid var(--help-accent);
  outline-offset: -3px;
  border-radius: calc(var(--help-radius) - 1px);
}

.faq-list details > summary {
  min-height: 56px;
  padding: 12px 16px;
}

.faq-list details > summary > span {
  border-color: var(--help-active-border);
  background: var(--help-tint);
}

.faq-list details p {
  padding-inline: 16px;
}

/* Keep guidance next to a field legible without giving it the weight of a warning. */
:is(.access-note, .owner-start-help, .auth-hint, .help-text, .field-hint, .floor-editor-canvas-help) {
  color: var(--help-muted);
  font-size: 13px;
  line-height: 1.5;
}

.signup-terms {
  border-color: var(--help-border);
  border-radius: var(--help-radius);
  background: var(--help-tint);
}

@media (min-width: 620px) {
  #owner-help [data-owner-settings-guide] {
    padding-block-end: 0;
  }

  .owner-help-questions details > summary {
    min-height: 46px;
    padding-block: 10px;
  }

  .owner-help-topics > div {
    padding-block: 10px;
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    column-gap: 10px;
  }

  #owner-help .owner-help-topics dd {
    grid-column: 2;
  }

  #owner-help .owner-help-topics dt + dd {
    margin-top: 0;
  }
}
