* { box-sizing: border-box; }
body, h2, p { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: max(10px,env(safe-area-inset-top)) clamp(12px,3vw,44px) 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 680;
  letter-spacing: -.025em;
}
.mast nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mast nav .secondary { padding-inline: 9px; }
.primary, .secondary, .profile-button, .quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
}
:is(.secondary,.profile-button,.quiet):hover:not(:disabled) { background: var(--hover); }
.primary { color: var(--surface); background: var(--primary); border-color: var(--primary); }
.primary:hover { background: var(--primary-hover); }
.welcome-main { width: min(760px,100%); margin: auto; padding: 0 14px; }
.shelf { padding-block: 24px; }
.shelf h2, .dialog-head h1 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 680;
  letter-spacing: -.025em;
}
.shelf ul { list-style: none; padding: 0; }
.shelf li { border-bottom: 1px solid var(--line); }
.shelf a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 12px 0; }
dialog {
  padding: 0;
  width: min(440px,calc(100% - 26px));
  max-height: calc(100dvh - 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius-dialog);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-float);
}
dialog::backdrop { background: var(--backdrop); }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.profile-body { display: grid; gap: 12px; padding: 18px 20px 20px; }
.profile-body section, .profile-body form { display: grid; justify-items: start; gap: 12px; }
.profile-body p { color: var(--muted); }
.profile-body input:not([type=checkbox]) {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}
.profile-body .check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
#profile-status:empty { display: none; }
body[data-account-page] :is(#profile-open,.dialog-head form) { display: none; }
body[data-account-page] dialog {
  position: static;
  width: min(440px,100%);
  max-height: none;
  margin: clamp(28px,10dvh,112px) auto max(24px,env(safe-area-inset-bottom));
}
body[data-account-page] dialog:focus { outline: none; }
body[data-account-page] :is(#signed-out,#my-plot) { justify-items: stretch; }
body[data-account-page] #guest-entry { justify-self: center; padding: 10px 0; font-size: .875rem; }

.display-name-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.display-name-row input { min-width: 0; }
#chat-profile p { font-size: .875rem; }
