/* Host page for HAXcms in the browser: a status bar and the HAXcms frame. */
:root {
  color-scheme: light dark;
  /* the network bar's colors (DDD coalyGray, keystoneYellow) */
  --bar-bg: #262626;
  --bar-fg: #ffffff;
  --bar-link: #ffd100;
  --ok: #3fe0a5;
  --wait: #ffd100;
  --bad: #ff7a70;
  --details-bg: #1b1b1b;
  --details-tile: #2f2f2f;
  --details-line: #ffffff2e;
  --details-muted: #cfcfcf;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  display: flex;
  flex-direction: column;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 14px;
  line-height: 1.4;
}
/* The network bar is a HAX element, so DDD (the HAX design system) adds
   its global styles to this page: margins, borders and fonts for headings,
   paragraphs, lists, links and form parts. This page's own parts are styled
   here, so inside them those go back to the browser's defaults (revert).
   The :not(svg):not(math) only adds weight: these resets outrank DDD's
   element rules (a type, two types, a:any-link) and still lose to every
   class rule below, which say what these parts look like. */
:where(.bar, .bar-note, .details, .publish, .toast, .message)
  :is(
    h1,
    h2,
    h3,
    p,
    dl,
    dt,
    dd,
    ul,
    ol,
    li,
    pre,
    code,
    summary,
    details,
    select
  ):not(svg):not(math) {
  margin: revert;
  padding: revert;
  border: revert;
  display: revert;
  min-height: revert;
  max-width: revert;
  overflow: revert;
  position: revert;
  font-family: revert;
  font-size: revert;
  font-weight: revert;
  font-style: revert;
  line-height: revert;
  letter-spacing: revert;
  list-style: revert;
  flex-direction: revert;
  flex-wrap: revert;
  gap: revert;
  background-color: revert;
  color: revert;
  white-space: revert;
  border-radius: revert;
  box-sizing: revert;
  width: revert;
  cursor: revert;
  transition: revert;
  user-select: revert;
}
:where(.bar, .bar-note, .details, .publish, .toast, .message)
  a:any-link:not(svg):not(math) {
  font-weight: revert;
  line-break: revert;
  text-decoration: revert;
  background-color: revert;
  color: revert;
}

/* The bar is the HAX network's mini bar (hax-network-bar compact); this
   app's status and functions sit in its pre slot, styled here because
   slotted content belongs to this page. */
.bar {
  flex: none;
  color: var(--bar-fg);
}
.bar p {
  margin: 0;
}
hax-network-bar {
  --hax-network-bar-gutter: 12px;
  display: block;
  /* until the element loads: the same color, so nothing jumps */
  min-height: 48px;
  background: var(--bar-bg);
}
.bar-app {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  height: 100%;
}
.bar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
}
.bar-status #status {
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-note {
  padding: 6px 12px;
  background: var(--details-bg);
  border-bottom: 1px solid var(--details-line);
  color: var(--wait);
}
/* the note under the bar is for warnings and notices; where sites are saved
   otherwise shows as the storage button and in Details */
.bar-note:empty,
.bar-note:not([data-state="warning"]):not([data-state="notice"]) {
  display: none;
}
.bar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bar [hidden] {
  display: none;
}
.bar a:any-link,
.bar button {
  color: var(--bar-link);
  font: inherit;
  font-weight: 600;
}
.bar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  background: none;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 0 10px;
  white-space: nowrap;
  cursor: pointer;
}
.bar button.primary {
  background: var(--bar-link);
  border-color: var(--bar-link);
  color: var(--bar-bg);
}
.bar button:hover {
  background: #ffffff1f;
}
.bar button.primary:hover {
  background: #ffe066;
}
.bar a:focus-visible,
.bar button:focus-visible {
  outline: 2px solid var(--bar-fg);
  outline-offset: 2px;
}
/* where sites are saved: an icon and a short name; opens Details */
.bar button.bar-where {
  max-width: 220px;
  border-color: var(--details-line);
  color: var(--bar-fg);
}
.bar button.bar-where[aria-expanded="true"] {
  background: var(--details-bg);
  border-color: var(--bar-fg);
}
.bar-where[data-where="memory"] .where-icon {
  fill: var(--wait);
}
.bar-where svg {
  flex: none;
  fill: currentColor;
}
.bar-where .where-icon {
  width: 18px;
  height: 18px;
}
.bar-where .caret {
  width: 18px;
  height: 18px;
}
.bar-where[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}
.where-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
/* narrower: the status is the dot alone (its words stay for screen readers) */
@media (max-width: 1100px) {
  .bar-status #status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
@media (max-width: 700px) {
  .bar-app {
    gap: 6px;
  }
  .where-label,
  .bar-where .caret {
    display: none;
  }
  .bar button {
    padding: 0 8px;
  }
  .bar button.bar-where {
    padding: 0 6px;
  }
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--wait);
  flex: none;
}
.dot[data-state="ready"] {
  background: var(--ok);
}
.dot[data-state="error"] {
  background: var(--bad);
}
/* Details: what this session is doing, and where to go next with HAX. It
   opens under the bar as part of it, in two columns that stack on phones. */
/* in the page for screen readers and search, not shown */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.details {
  background: var(--details-bg);
  color: var(--bar-fg);
  border-bottom: 1px solid var(--details-line);
}
.details-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 24px;
}
.details h2 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--details-muted);
}
.details-where {
  margin-bottom: 20px;
  padding: 12px;
  border: 1px solid var(--details-line);
  border-radius: 6px;
  background: var(--details-tile);
}
.details-where .details-actions {
  margin-top: 12px;
}
.details-where .details-actions:not(:has(button:not([hidden]))) {
  display: none;
}
.details dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  margin: 0;
}
.details dl > div {
  padding: 10px 12px;
  border: 1px solid var(--details-line);
  border-radius: 6px;
  background: var(--details-tile);
}
.details dt {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--details-muted);
}
.details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.details p {
  margin: 0;
}
.details p.details-report {
  margin-top: 12px;
  color: var(--details-muted);
}
/* :any-link: the HAX elements on this page add DDD's global link color
   (body a:any-link), which these must outrank */
.details a:any-link {
  color: var(--bar-link);
  font-weight: 600;
}
.details svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.details a:focus-visible {
  outline: 2px solid var(--bar-fg);
  outline-offset: 2px;
}
/* Install and work offline: its own block under About this session. */
.details h2.details-app-title {
  margin-top: 24px;
}
.details-app {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  border: 1px solid var(--details-line);
  border-radius: 6px;
  background: var(--details-tile);
}
.details-app [hidden] {
  display: none;
}
.details-app p:empty {
  display: none;
}
.details-app progress {
  width: 100%;
  accent-color: var(--bar-link);
}
.details-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.details-actions button {
  padding: 4px 12px;
  border: 1px solid var(--bar-link);
  border-radius: 4px;
  background: none;
  color: var(--bar-link);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.details-actions button:disabled {
  opacity: 0.6;
  cursor: progress;
}
.details-actions button:focus-visible {
  outline: 2px solid var(--bar-fg);
  outline-offset: 2px;
}
.details p.details-help {
  color: var(--details-muted);
  font-size: 13px;
}
@media (forced-colors: active) {
  .details dl > div {
    border: 1px solid CanvasText;
  }
}
.stage {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}
.stage iframe {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
}
.message {
  margin: 2rem;
  max-width: 60ch;
  font-size: 16px;
}
.message pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}
/* Publish: a dialog over the page, in the same colors as Details. */
.publish {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--details-line);
  border-radius: 8px;
  background: var(--details-bg);
  color: var(--bar-fg);
}
.publish::backdrop {
  background: #000a;
}
.publish form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}
.publish h2 {
  margin: 0;
  font-size: 18px;
}
.publish p {
  margin: 0;
}
.publish [hidden] {
  display: none;
}
.publish-intro,
.publish-none,
.publish-help {
  color: var(--details-muted);
}
.publish-help {
  font-size: 13px;
}
.publish code {
  overflow-wrap: anywhere;
  font-size: 13px;
}
.publish-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.publish label {
  font-weight: 600;
}
.publish-fields > label {
  margin-top: 6px;
}
.publish input[type="text"],
.publish input[type="email"],
.publish input[type="password"],
.publish select {
  box-sizing: border-box;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--details-line);
  border-radius: 4px;
  background: var(--details-tile);
  color: var(--bar-fg);
  font: inherit;
}
.publish-address {
  display: flex;
  align-items: center;
  gap: 4px;
}
.publish-address span {
  color: var(--details-muted);
}
.publish-auth {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--details-line);
  border-radius: 6px;
}
.publish-auth legend {
  padding: 0 4px;
  font-weight: 700;
}
.publish-auth > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.publish-auth-token,
.publish-auth-password {
  margin-top: 4px;
}
.publish-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}
.publish-signed-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.publish-status:empty {
  display: none;
}
.publish-status {
  padding: 8px 10px;
  border-radius: 4px;
  background: var(--details-tile);
  overflow-wrap: anywhere;
}
.publish-status[data-state="error"] {
  color: var(--bad);
}
.publish-status[data-state="ready"] {
  color: var(--ok);
}
.publish-status a:any-link {
  color: var(--bar-link);
  font-weight: 700;
}
.publish-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.publish button {
  padding: 6px 14px;
  border: 1px solid var(--bar-link);
  border-radius: 4px;
  background: none;
  color: var(--bar-link);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.publish button.primary {
  background: var(--bar-link);
  color: var(--bar-bg);
}
.publish button:disabled {
  opacity: 0.6;
  cursor: progress;
}
.publish a:focus-visible,
.publish button:focus-visible,
.publish input:focus-visible,
.publish select:focus-visible {
  outline: 2px solid var(--bar-fg);
  outline-offset: 2px;
}
@media (forced-colors: active) {
  .publish,
  .publish-auth,
  .publish button {
    border: 1px solid CanvasText;
  }
}
/* Shared with HAX: the Publish dialog's look, plus the list of what came. */
.share-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 8px 10px 8px 28px;
  border-radius: 4px;
  background: var(--details-tile);
  overflow-wrap: anywhere;
}
.share-items:empty {
  display: none;
}
.share .publish-actions {
  flex-wrap: wrap;
}
#share-descriptions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#share-descriptions label {
  margin-top: 6px;
}
/* A notice with something to do about it, over the corner of the page. */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid var(--details-line);
  border-radius: 8px;
  background: var(--details-bg);
  color: var(--bar-fg);
  box-shadow: 0 6px 24px #0008;
}
.toast[hidden],
.toast [hidden] {
  display: none;
}
.toast p {
  margin: 0;
}
.toast-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.toast button {
  padding: 6px 14px;
  border: 1px solid var(--bar-link);
  border-radius: 4px;
  background: none;
  color: var(--bar-link);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.toast button.primary {
  background: var(--bar-link);
  color: var(--bar-bg);
}
.toast button:focus-visible {
  outline: 2px solid var(--bar-fg);
  outline-offset: 2px;
}
@media (forced-colors: active) {
  .toast,
  .toast button,
  .details-app,
  .details-actions button {
    border: 1px solid CanvasText;
  }
}
/* Installed, the app has no browser bar above it: keep clear of the notch. */
@media (display-mode: standalone) {
  .bar {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    background: var(--bar-bg);
  }
}
/* Sign in and Save to the cloud: provider choices, in the Publish dialog's colors. */
.provider-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.provider-list:empty {
  display: none;
}
.publish button.provider {
  width: 100%;
  padding: 10px 14px;
  text-align: left;
}
.publish-account-host,
.publish-surge {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cloud-webdav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--details-line);
  border-radius: 6px;
}
.cloud-webdav[open] {
  padding-bottom: 12px;
}
.cloud-webdav summary {
  font-weight: 700;
  cursor: pointer;
}
/* DDD draws summaries as its own accordion (a fill, a + / - after the text,
   no marker); this one keeps the browser's marker and the dialog's colors */
.publish .cloud-webdav > summary {
  background-color: transparent;
  color: inherit;
  filter: none;
}
.publish .cloud-webdav > summary::marker {
  content: normal;
}
.publish .cloud-webdav > summary::after {
  content: none;
}
.publish .cloud-webdav > summary:focus-visible {
  outline: 2px solid var(--bar-fg);
  outline-offset: 2px;
}
.cloud-webdav label {
  display: block;
  margin-top: 6px;
}
.cloud-webdav input {
  margin-top: 4px;
}
.cloud-webdav button {
  margin-top: 10px;
  align-self: flex-start;
}
.publish input[type="url"] {
  box-sizing: border-box;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--details-line);
  border-radius: 4px;
  background: var(--details-tile);
  color: var(--bar-fg);
  font: inherit;
}
