/* ═══════════════════════════════════════════════════════════════════════════════
   AVIV · ATELIER — helpers for the pages that build their own markup with script
   (sign-in, welcome, developer tools, search, setup checklist, site map)
   ═══════════════════════════════════════════════════════════════════════════════ */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

code,
.code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--sunken);
  color: var(--ink-2);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.92em;
}

.check__box .icon {
  display: none;
}

.btn--icon {
  width: 34px;
  padding: 0;
}

.btn__label {
  display: inline;
}

.check__label {
  line-height: 1.35;
}

.field__wrap--btn > .field__input {
  padding-right: 44px;
}

.field__btn {
  position: absolute;
  right: 4px;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}

.field__btn:hover {
  background: var(--sunken);
  color: var(--ink);
}

/* native dialogs */
dialog.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-4);
  overflow: hidden;
}

dialog.dialog--sm {
  width: min(440px, calc(100vw - 32px));
}

dialog.dialog--lg {
  width: min(780px, calc(100vw - 32px));
}

dialog.dialog[open] {
  display: flex;
  flex-direction: column;
  animation: av-pop 240ms var(--ease);
}

dialog.dialog::backdrop {
  background: rgb(6 28 22 / 0.5);
  backdrop-filter: blur(4px);
}

dialog.dialog > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px 10px;
}

.dialog__title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
}

.dialog__desc {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 13px;
}

.dialog__body {
  padding: 6px 22px 18px;
  overflow: auto;
}

.dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 22px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 var(--line);
}

.otp__input {
  font-size: 20px;
  letter-spacing: 0.4em;
  text-align: center;
}

/* pages that wrap their content in a plain column */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px var(--gutter) 56px;
}

.sm {
  font-size: 12px;
  color: var(--ink-3);
}

/* sortable table headers built by script: text must stay readable on the tinted background */
.dt__sort {
  color: var(--ink-2);
}

/* tab counters are a light pill with dark text on every tab, selected or not (7.3 : 1) */
.tabs__count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--ink-2);
}
