/* Shared by every page: page frame, gutter, top bar, theme toggle, footer, the "Não implementado" flag, problems */
[hidden] {
  display: none !important;
}
html {
  background: var(--surface);
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app-x {
  --gutter: clamp(20px, 5vw, 80px);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.app-icon-btn {
  width: 40px;
  padding: 0;
}
/* theme toggle: the button holds both icons and shows the one for the other theme */
.app-theme__sun,
[data-theme="dark"] .app-theme__moon {
  display: none;
}
[data-theme="dark"] .app-theme__sun {
  display: inline-block;
}

/* top bar of the signed-out pages */
.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.app-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-6);
  padding-top: var(--space-6);
  padding-bottom: max(var(--space-6), env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-muted);
}
.app-foot__end {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}
.app-foot a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.app-foot a:hover {
  color: var(--ink);
}

/* marks a feature that waits on the backend; dashed, so it never reads as part of the design */
.ni {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  font: 400 13px/18px var(--font-body);
  color: var(--ink-muted);
  min-width: 0;
}
.ni__what {
  overflow-wrap: anywhere;
}

/* a real failure (APP.problem): a danger Status and what happened, in plain words */
.app-problem {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  font: 400 14px/20px var(--font-body);
  color: var(--ink);
  min-width: 0;
}
.app-problem > span:last-child {
  flex: 1 1 16em;
  overflow-wrap: anywhere;
}

/* read by screen readers, not shown: the words for a state the page shows visually */
.app-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
